diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2023-07-17 11:12:19 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-07-21 16:00:18 -0300 |
commit | 448d15aab34293bf139f17c17910e854d9ad7d6c (patch) | |
tree | 8474ff655c916646da944dbc09aae524f846dc44 | |
parent | bad5b6e34ffbaacc77ad28a0f482e33b3929e635 (diff) |
RDMA/core: Set gid_attr.ndev for iWARP devices
Have the iwarp side properly set the ndev in the device's sgid_attrs
so that address resolution can treat it more like a RoCE device.
Link: https://lore.kernel.org/r/168960673933.3007.8043081822081877578.stgit@manet.1015granger.net
Suggested-by: Jason Gunthorpe <jgg@nvidia.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>
-rw-r--r-- | drivers/infiniband/core/cache.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 2e91d8879326..33f9d02f9b60 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1457,6 +1457,17 @@ static int config_non_roce_gid_cache(struct ib_device *device, i); goto err; } + + if (rdma_protocol_iwarp(device, port)) { + struct net_device *ndev; + + ndev = ib_device_get_netdev(device, port); + if (!ndev) + continue; + RCU_INIT_POINTER(gid_attr.ndev, ndev); + dev_put(ndev); + } + gid_attr.index = i; tprops->subnet_prefix = be64_to_cpu(gid_attr.gid.global.subnet_prefix); |