diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2023-07-17 11:12:12 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-07-21 16:00:18 -0300 |
commit | bad5b6e34ffbaacc77ad28a0f482e33b3929e635 (patch) | |
tree | 4ca6ea33624b326dfb38d6d168f96ba13999a360 /drivers/infiniband/sw/siw/siw.h | |
parent | 666f526b6dd1851184abc12f7901c813a097fa93 (diff) | |
download | linux-bad5b6e34ffbaacc77ad28a0f482e33b3929e635.tar.gz linux-bad5b6e34ffbaacc77ad28a0f482e33b3929e635.tar.bz2 linux-bad5b6e34ffbaacc77ad28a0f482e33b3929e635.zip |
RDMA/siw: Fabricate a GID on tun and loopback devices
LOOPBACK and NONE (tunnel) devices have all-zero MAC addresses.
Currently, siw_device_create() falls back to copying the IB device's
name in those cases, because an all-zero MAC address breaks the RDMA
core address resolution mechanism.
However, at the point when siw_device_create() constructs a GID, the
ib_device::name field is uninitialized, leaving the MAC address to
remain in an all-zero state.
Fabricate a random artificial GID for such devices, and ensure this
artificial GID is returned for all device query operations.
Link: https://lore.kernel.org/r/168960673260.3007.12378736853793339110.stgit@manet.1015granger.net
Reported-by: Tom Talpey <tom@talpey.com>
Fixes: a2d36b02c15d ("RDMA/siw: Enable siw on tunnel devices")
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw.h')
-rw-r--r-- | drivers/infiniband/sw/siw/siw.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/siw/siw.h b/drivers/infiniband/sw/siw/siw.h index 2f3a9cda3850..8b4a710b82bc 100644 --- a/drivers/infiniband/sw/siw/siw.h +++ b/drivers/infiniband/sw/siw/siw.h @@ -74,6 +74,7 @@ struct siw_device { u32 vendor_part_id; int numa_node; + char raw_gid[ETH_ALEN]; /* physical port state (only one port per device) */ enum ib_port_state state; |