OSDN Git Service

RDMA/device: Add ib_device_set_netdev() as an alternative to get_netdev
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 13 Feb 2019 04:12:50 +0000 (21:12 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 20 Feb 2019 03:52:18 +0000 (20:52 -0700)
commitc2261dd76b549754c14c8ac7cadadd0993b182d6
tree1633597dbb212404d2542ea368a872e90d75d50a
parent8faea9fd4a3914f12cd343e10810ec5f4215ddd6
RDMA/device: Add ib_device_set_netdev() as an alternative to get_netdev

The associated netdev should not actually be very dynamic, so for most
drivers there is no reason for a callback like this. Provide an API to
inform the core code about the net dev affiliation and use a core
maintained data structure instead.

This allows the core code to be more aware of the ndev relationship which
will allow some new APIs based around this.

This also uses locking that makes some kind of sense, many drivers had a
confusing RCU lock, or missing locking which isn't right.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cache.c
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/device.c
drivers/infiniband/core/nldev.c
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h