diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-07-26 11:55:30 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-07-28 11:35:58 -0700 |
commit | 84e00d9bd4e472bd9b145ed40dbd132dd7a15462 (patch) | |
tree | b977b7a1bda1dfea681cdcc02acdfd6f51ec7d41 /include/linux/netdevice.h | |
parent | 759ab1edb56c88906830fd6b2e7b12514dd32758 (diff) | |
download | linux-84e00d9bd4e472bd9b145ed40dbd132dd7a15462.tar.gz |
net: convert some netlink netdev iterators to depend on the xarray
Reap the benefits of easier iteration thanks to the xarray.
Convert just the genetlink ones, those are easier to test.
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230726185530.2247698-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 32a4cdf37dd470..84c36a7f873fd9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3016,6 +3016,9 @@ extern rwlock_t dev_base_lock; /* Device list lock */ if (netdev_master_upper_dev_get_rcu(slave) == (bond)) #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) +#define for_each_netdev_dump(net, d, ifindex) \ + xa_for_each_start(&(net)->dev_by_index, (ifindex), (d), (ifindex)) + static inline struct net_device *next_net_device(struct net_device *dev) { struct list_head *lh; |