Commit 0abfc79d authored by Kamal Heib's avatar Kamal Heib Committed by Jason Gunthorpe

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.

Link: https://lore.kernel.org/r/20211124102336.427637-1-kamalheib1@gmail.comSigned-off-by: default avatarKamal Heib <kamalheib1@gmail.com>
Acked-by: default avatarBernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 925cac63
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/xarray.h> #include <linux/xarray.h>
#include <net/addrconf.h>
#include <rdma/iw_cm.h> #include <rdma/iw_cm.h>
#include <rdma/ib_verbs.h> #include <rdma/ib_verbs.h>
...@@ -155,7 +156,8 @@ int siw_query_device(struct ib_device *base_dev, struct ib_device_attr *attr, ...@@ -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_id = SIW_VENDOR_ID;
attr->vendor_part_id = sdev->vendor_part_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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment