projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
925cac6
)
RDMA/siw: Use helper function to set sys_image_guid
author
Kamal Heib
<kamalheib1@gmail.com>
Wed, 24 Nov 2021 10:23:36 +0000
(12:23 +0200)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Thu, 25 Nov 2021 17:35:08 +0000
(13:35 -0400)
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.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/siw/siw_verbs.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/sw/siw/siw_verbs.c
b/drivers/infiniband/sw/siw/siw_verbs.c
index 1b36350601faaabc374207a4dce673894e1aad86..d15a1f9c59f03a390bbef7ca0c6b77df7ddba579 100644
(file)
--- a/
drivers/infiniband/sw/siw/siw_verbs.c
+++ b/
drivers/infiniband/sw/siw/siw_verbs.c
@@
-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;
}