mbox series

[net-next,0/3] net: introduce per-netns netdevice notifiers and use them in mlxsw

Message ID 20190930081511.26915-1-jiri@resnulli.us
Headers show
Series net: introduce per-netns netdevice notifiers and use them in mlxsw | expand

Message

Jiri Pirko Sept. 30, 2019, 8:15 a.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

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 also a preparation for upcoming patchset "devlink: allow devlink
instances to change network namespace". This resolves deadlock during
reload mlxsw into initial netns made possible by
328fbe747ad4 ("net: Close race between {un, }register_netdevice_notifier() and setup_net()/cleanup_net()").

Jiri Pirko (3):
  net: push loops and nb calls into helper functions
  net: introduce per-netns netdevice notifiers
  mlxsw: spectrum: Use per-netns netdevice notifier registration

 .../net/ethernet/mellanox/mlxsw/spectrum.c    |   9 +-
 include/linux/netdevice.h                     |   6 +
 include/net/net_namespace.h                   |   6 +-
 net/core/dev.c                                | 176 +++++++++++++++---
 4 files changed, 165 insertions(+), 32 deletions(-)

Comments

David Miller Oct. 2, 2019, 3:52 p.m. UTC | #1
From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 30 Sep 2019 10:15:08 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> 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 also a preparation for upcoming patchset "devlink: allow devlink
> instances to change network namespace". This resolves deadlock during
> reload mlxsw into initial netns made possible by
> 328fbe747ad4 ("net: Close race between {un, }register_netdevice_notifier() and setup_net()/cleanup_net()").

Series applied.