summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/core_priv.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-02-13 07:12:50 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-02-20 06:52:18 +0300
commitc2261dd76b549754c14c8ac7cadadd0993b182d6 (patch)
tree1633597dbb212404d2542ea368a872e90d75d50a /drivers/infiniband/core/core_priv.h
parent8faea9fd4a3914f12cd343e10810ec5f4215ddd6 (diff)
downloadlinux-c2261dd76b549754c14c8ac7cadadd0993b182d6.tar.xz
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>
Diffstat (limited to 'drivers/infiniband/core/core_priv.h')
-rw-r--r--drivers/infiniband/core/core_priv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index eeabe9ca8427..08c690249594 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -66,6 +66,9 @@ typedef void (*roce_netdev_callback)(struct ib_device *device, u8 port,
typedef bool (*roce_netdev_filter)(struct ib_device *device, u8 port,
struct net_device *idev, void *cookie);
+struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
+ unsigned int port);
+
void ib_enum_roce_netdev(struct ib_device *ib_dev,
roce_netdev_filter filter,
void *filter_cookie,