All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/qed: Use helper function to set GUIDs
@ 2021-10-31 17:07 Kamal Heib
  2021-11-01 13:05 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Kamal Heib @ 2021-10-31 17:07 UTC (permalink / raw)
  To: linux-rdma
  Cc: Michal Kalderon, Ariel Elior, Doug Ledford, Jason Gunthorpe, Kamal Heib

Use addrconf_addr_eui48() helper function to set the GUIDs and remove
the driver specific version.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_rdma.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c
index 4f4b79250a2b..4af24dc2e82e 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
+#include <net/addrconf.h>
 #include "qed.h"
 #include "qed_cxt.h"
 #include "qed_hsi.h"
@@ -410,18 +411,6 @@ static void qed_rdma_free(struct qed_hwfn *p_hwfn)
 	qed_rdma_resc_free(p_hwfn);
 }
 
-static void qed_rdma_get_guid(struct qed_hwfn *p_hwfn, u8 *guid)
-{
-	guid[0] = p_hwfn->hw_info.hw_mac_addr[0] ^ 2;
-	guid[1] = p_hwfn->hw_info.hw_mac_addr[1];
-	guid[2] = p_hwfn->hw_info.hw_mac_addr[2];
-	guid[3] = 0xff;
-	guid[4] = 0xfe;
-	guid[5] = p_hwfn->hw_info.hw_mac_addr[3];
-	guid[6] = p_hwfn->hw_info.hw_mac_addr[4];
-	guid[7] = p_hwfn->hw_info.hw_mac_addr[5];
-}
-
 static void qed_rdma_init_events(struct qed_hwfn *p_hwfn,
 				 struct qed_rdma_start_in_params *params)
 {
@@ -449,7 +438,9 @@ static void qed_rdma_init_devinfo(struct qed_hwfn *p_hwfn,
 	dev->fw_ver = (FW_MAJOR_VERSION << 24) | (FW_MINOR_VERSION << 16) |
 		      (FW_REVISION_VERSION << 8) | (FW_ENGINEERING_VERSION);
 
-	qed_rdma_get_guid(p_hwfn, (u8 *)&dev->sys_image_guid);
+	addrconf_addr_eui48((u8 *)&dev->sys_image_guid,
+			    p_hwfn->hw_info.hw_mac_addr);
+
 	dev->node_guid = dev->sys_image_guid;
 
 	dev->max_sge = min_t(u32, RDMA_MAX_SGE_PER_SQ_WQE,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-next] RDMA/qed: Use helper function to set GUIDs
  2021-10-31 17:07 [PATCH for-next] RDMA/qed: Use helper function to set GUIDs Kamal Heib
@ 2021-11-01 13:05 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-11-01 13:05 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Michal Kalderon, Ariel Elior, Doug Ledford

On Sun, Oct 31, 2021 at 07:07:43PM +0200, Kamal Heib wrote:
> Use addrconf_addr_eui48() helper function to set the GUIDs and remove
> the driver specific version.
> 
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
>  drivers/net/ethernet/qlogic/qed/qed_rdma.c | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-01 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 17:07 [PATCH for-next] RDMA/qed: Use helper function to set GUIDs Kamal Heib
2021-11-01 13:05 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.