]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/i40iw: Associate ibdev to netdev before IB device registration
authorShiraz, Saleem <shiraz.saleem@intel.com>
Wed, 25 Sep 2019 16:45:24 +0000 (11:45 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 4 Oct 2019 17:29:14 +0000 (14:29 -0300)
commit8d341d36a628cbaa1d9ab40d4ff55f568ce0ae93
tree632a2b05b699da68fddb860d5dc1b40f19799cc6
parentedc58b01290856703941bc64e0869db8835ae99b
RDMA/i40iw: Associate ibdev to netdev before IB device registration

i40iw IB device registration fails with ENODEV.

ib_register_device
 setup_device/setup_port_data
  i40iw_port_immutable
   ib_query_port
     iw_query_port
      ib_device_get_netdev(ENODEV)

ib_device_get_netdev() does not have a netdev associated
with the ibdev and thus fails.
Use ib_device_set_netdev() to associate netdev to ibdev
in i40iw before IB device registration.

Fixes: 37db4465f5c7 ("RDMA/core: Add common iWARP query port")
Link: https://lore.kernel.org/r/20190925164524.856-1-shiraz.saleem@intel.com
Signed-off-by: Shiraz, Saleem <shiraz.saleem@intel.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_verbs.c