@@ -1439,6 +1439,7 @@ static int config_non_roce_gid_cache(struct ib_device *device,
{
struct ib_gid_attr gid_attr = {};
struct ib_gid_table *table;
+ struct net_device *ndev;
int ret = 0;
int i;
@@ -1457,10 +1458,21 @@ static int config_non_roce_gid_cache(struct ib_device *device,
i);
goto err;
}
+
+ ndev = NULL;
+ if (rdma_protocol_iwarp(device, port)) {
+ ndev = ib_device_get_netdev(device, port);
+ if (!ndev)
+ continue;
+ RCU_INIT_POINTER(gid_attr.ndev, ndev);
+ }
+
gid_attr.index = i;
tprops->subnet_prefix =
be64_to_cpu(gid_attr.gid.global.subnet_prefix);
add_modify_gid(table, &gid_attr);
+
+ dev_put(ndev);
}
err:
mutex_unlock(&table->lock);