summaryrefslogtreecommitdiff
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2022-11-02 17:02:07 +0100
committerJakub Kicinski <kuba@kernel.org>2022-11-03 20:48:35 -0700
commit31265c1e29eb28f17df50d04ee421b5b6369fefd (patch)
tree86288d3757fbb2bbe74ea4f6f7bb124e8cdfb6d1 /include/net/devlink.h
parentd0f5172629339f4a9cbbe5f9ae51cea48b4af333 (diff)
net: devlink: store copy netdevice ifindex and ifname to allow port_fill() without RTNL held
To avoid a need to take RTNL mutex in port_fill() function, benefit from the introduce infrastructure that tracks netdevice notifier events. Store the ifindex and ifname upon register and change name events. Remove the rtnl_held bool propagated down to port_fill() function as it is no longer needed. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index b1582b32183a..7befad57afd4 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -129,6 +129,8 @@ struct devlink_port {
union {
struct {
struct net_device *netdev;
+ int ifindex;
+ char ifname[IFNAMSIZ];
} type_eth;
struct {
struct ib_device *ibdev;