[SRU][F:linux-bluefield][PATCH 0/4] Allow devlink instances to change network namespace

Bodong Wang bodong at nvidia.com
Fri Jan 13 18:09:11 UTC 2023


Some drivers, like mlxsw, are not interested in notifications coming in
for netdevices from other network namespaces. So introduce per-netns
notifiers and allow to reduce overhead by listening only for
notifications from the same netns. This is done by first two patches.

After we have per-net notifier, which allows to get only
notifications relevant to particular network namespace. That is enough
for drivers that have netdevs local in a particular namespace (cannot
move elsewhere).

However if netdev can change namespace, per-net notifier cannot be used.
Introduce dev_net variant that is basically per-net notifier with an
extension that re-registers the per-net notifier upon netdev namespace
change. Basically the per-net notifier follows the netdev into
namespace. This is done by the last two patches.

Jiri Pirko (4):
  net: push loops and nb calls into helper functions
  net: introduce per-netns netdevice notifiers
  net: push code from net notifier reg/unreg into helpers
  net: introduce dev_net notifier register/unregister variants

 include/linux/netdevice.h   |  23 ++++
 include/net/net_namespace.h |   5 +-
 net/core/dev.c              | 238 +++++++++++++++++++++++++++++++-----
 3 files changed, 237 insertions(+), 29 deletions(-)

-- 
2.27.0




More information about the kernel-team mailing list