Commit 265e352b authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'net-notify-users-when-an-iface-cannot-change-its-netns'

Nicolas Dichtel says:

====================
net: notify users when an iface cannot change its netns

This series adds a way to see if an interface cannot be moved to another netns.

 Documentation/netlink/specs/rt_link.yaml           |  3 ++
 .../networking/net_cachelines/net_device.rst       |  2 +-
 Documentation/networking/switchdev.rst             |  2 +-
 drivers/net/amt.c                                  |  2 +-
 drivers/net/bonding/bond_main.c                    |  2 +-
 drivers/net/ethernet/adi/adin1110.c                |  2 +-
 .../net/ethernet/marvell/prestera/prestera_main.c  |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  4 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  2 +-
 drivers/net/ethernet/rocker/rocker_main.c          |  2 +-
 drivers/net/ethernet/ti/cpsw_new.c                 |  2 +-
 drivers/net/loopback.c                             |  2 +-
 drivers/net/net_failover.c                         |  2 +-
 drivers/net/team/team_core.c                       |  2 +-
 drivers/net/vrf.c                                  |  2 +-
 include/linux/netdevice.h                          |  9 +++--
 include/uapi/linux/if_link.h                       |  1 +
 net/batman-adv/soft-interface.c                    |  2 +-
 net/bridge/br_device.c                             |  2 +-
 net/core/dev.c                                     | 45 +++++++++++++++++-----
 net/core/rtnetlink.c                               |  5 ++-
 net/hsr/hsr_device.c                               |  2 +-
 net/ieee802154/6lowpan/core.c                      |  2 +-
 net/ieee802154/core.c                              | 10 ++---
 net/ipv4/ip_tunnel.c                               |  2 +-
 net/ipv4/ipmr.c                                    |  2 +-
 net/ipv6/ip6_gre.c                                 |  2 +-
 net/ipv6/ip6_tunnel.c                              |  2 +-
 net/ipv6/ip6mr.c                                   |  2 +-
 net/ipv6/sit.c                                     |  2 +-
 net/openvswitch/vport-internal_dev.c               |  2 +-
 net/wireless/core.c                                | 10 ++---
 tools/testing/selftests/net/forwarding/README      |  2 +-
 34 files changed, 86 insertions(+), 53 deletions(-)

Comments are welcome.

Regards,
Nicolas
====================

Link: https://patch.msgid.link/20250228102144.154802-1-nicolas.dichtel@6wind.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents af08cc40 12b6f706
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1160,6 +1160,9 @@ attribute-sets:
        name: max-pacing-offload-horizon
        type: uint
        doc: EDT offload horizon supported by the device (in nsec).
      -
        name: netns-immutable
        type: u8
  -
    name: af-spec-attrs
    attributes:
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ unsigned:1 wol_enabled
unsigned:1                          threaded                                                            napi_poll(napi_enable,dev_set_threaded)
unsigned_long:1                     see_all_hwtstamp_requests
unsigned_long:1                     change_proto_down
unsigned_long:1                     netns_local
unsigned_long:1                     netns_immutable
unsigned_long:1                     fcoe_mtu
struct list_head                    net_notifier_list
struct macsec_ops*                  macsec_ops
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ would be sub-port 0 on port 1 on switch 1.
Port Features
^^^^^^^^^^^^^

dev->netns_local
dev->netns_immutable

If the switchdev driver (and device) only supports offloading of the default
network namespace (netns), the driver should set this private flag to prevent
+1 −1
Original line number Diff line number Diff line
@@ -3099,7 +3099,7 @@ static void amt_link_setup(struct net_device *dev)
	dev->addr_len		= 0;
	dev->priv_flags		|= IFF_NO_QUEUE;
	dev->lltx		= true;
	dev->netns_local	= true;
	dev->netns_immutable	= true;
	dev->features		|= NETIF_F_GSO_SOFTWARE;
	dev->hw_features	|= NETIF_F_SG | NETIF_F_HW_CSUM;
	dev->hw_features	|= NETIF_F_FRAGLIST | NETIF_F_RXCSUM;
+1 −1
Original line number Diff line number Diff line
@@ -6025,7 +6025,7 @@ void bond_setup(struct net_device *bond_dev)
	bond_dev->lltx = true;

	/* Don't allow bond devices to change network namespaces. */
	bond_dev->netns_local = true;
	bond_dev->netns_immutable = true;

	/* By default, we declare the bond to be fully
	 * VLAN hardware accelerated capable. Special
Loading