@@ -2019,8 +2019,12 @@ static int iw_query_port(struct ib_device *device,
memset(port_attr, 0, sizeof(*port_attr));
netdev = ib_device_get_netdev(device, port_num);
+ /* Some iwarp device may be not binded to a netdev temporarily when
+ * ib_register_device called. To adapt this scenario, and let iWarp
+ * device drivers decide the return value.
+ */
if (!netdev)
- return -ENODEV;
+ goto query_port;
port_attr->max_mtu = IB_MTU_4096;
port_attr->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
@@ -2045,6 +2049,7 @@ static int iw_query_port(struct ib_device *device,
}
dev_put(netdev);
+query_port:
return device->ops.query_port(device, port_num, port_attr);
}