Skip to contentSkip to conversation

RDMA/siw: Use helper function to set sys_image_guid

PATCH Applied Kamal Heib 3 participants 3 messages Nov 24, 2021 – Nov 25, 2021

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/siw: Use helper function to set sys_image_guid

Use the addrconf_addr_eui48() helper function to set the sys_image_guid, Also make sure the GUID is valid EUI-64 identifier.

---
 drivers/infiniband/sw/siw/siw_verbs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +3 -1
index 1b36350601fa..d15a1f9c59f0 100644
@@ -8,6 +8,7 @@
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/xarray.h>
+#include <net/addrconf.h>
 
 #include <rdma/iw_cm.h>
 #include <rdma/ib_verbs.h>
@@ -155,7 +156,8 @@ int siw_query_device(struct ib_device *base_dev, struct ib_device_attr *attr,
 	attr->vendor_id = SIW_VENDOR_ID;
 	attr->vendor_part_id = sdev->vendor_part_id;
 
-	memcpy(&attr->sys_image_guid, sdev->netdev->dev_addr, 6);
+	addrconf_addr_eui48((u8 *)&attr->sys_image_guid,
+			    sdev->netdev->dev_addr);
 
 	return 0;
 }
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw

-----"Kamal Heib" <[email protected]> wrote: -----

Quoted 40 lines

To: [email protected]
From: "Kamal Heib" <[email protected]>
Date: 11/24/2021 11:24AM
Cc: "Bernard Metzler" <[email protected]>, "Jason Gunthorpe" <[email protected]>, "Kamal Heib" <[email protected]>
Subject: [EXTERNAL] [PATCH for-next] RDMA/siw: Use helper function to set sys_image_guid

Use the addrconf_addr_eui48() helper function to set the sys_image_guid,
Also make sure the GUID is valid EUI-64 identifier.

---
drivers/infiniband/sw/siw/siw_verbs.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +3 -1
index 1b36350601fa..d15a1f9c59f0 100644
@@ -8,6 +8,7 @@
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/xarray.h>
+#include <net/addrconf.h>
 
 #include <rdma/iw_cm.h>
 #include <rdma/ib_verbs.h>
@@ -155,7 +156,8 @@ int siw_query_device(struct ib_device *base_dev,
 struct ib_device_attr *attr,
 	attr->vendor_id = SIW_VENDOR_ID;
 	attr->vendor_part_id = sdev->vendor_part_id;
 
-	memcpy(&attr->sys_image_guid, sdev->netdev->dev_addr, 6);
+	addrconf_addr_eui48((u8 *)&attr->sys_image_guid,
+			    sdev->netdev->dev_addr);
 
 	return 0;
Quoted 5 lines

}

Signature · 1 line
2.31.1

Thanks, Kamal!