Skip to content

Commit 265e352

Browse files
author
Paolo Abeni
committed
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/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents af08cc4 + 12b6f70 commit 265e352

File tree

34 files changed

+86
-53
lines changed

34 files changed

+86
-53
lines changed

Documentation/netlink/specs/rt_link.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,9 @@ attribute-sets:
11601160
name: max-pacing-offload-horizon
11611161
type: uint
11621162
doc: EDT offload horizon supported by the device (in nsec).
1163+
-
1164+
name: netns-immutable
1165+
type: u8
11631166
-
11641167
name: af-spec-attrs
11651168
attributes:

Documentation/networking/net_cachelines/net_device.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ unsigned:1 wol_enabled
167167
unsigned:1 threaded napi_poll(napi_enable,dev_set_threaded)
168168
unsigned_long:1 see_all_hwtstamp_requests
169169
unsigned_long:1 change_proto_down
170-
unsigned_long:1 netns_local
170+
unsigned_long:1 netns_immutable
171171
unsigned_long:1 fcoe_mtu
172172
struct list_head net_notifier_list
173173
struct macsec_ops* macsec_ops

Documentation/networking/switchdev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ would be sub-port 0 on port 1 on switch 1.
137137
Port Features
138138
^^^^^^^^^^^^^
139139

140-
dev->netns_local
140+
dev->netns_immutable
141141

142142
If the switchdev driver (and device) only supports offloading of the default
143143
network namespace (netns), the driver should set this private flag to prevent

drivers/net/amt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,7 @@ static void amt_link_setup(struct net_device *dev)
30993099
dev->addr_len = 0;
31003100
dev->priv_flags |= IFF_NO_QUEUE;
31013101
dev->lltx = true;
3102-
dev->netns_local = true;
3102+
dev->netns_immutable = true;
31033103
dev->features |= NETIF_F_GSO_SOFTWARE;
31043104
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
31053105
dev->hw_features |= NETIF_F_FRAGLIST | NETIF_F_RXCSUM;

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6025,7 +6025,7 @@ void bond_setup(struct net_device *bond_dev)
60256025
bond_dev->lltx = true;
60266026

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

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

drivers/net/ethernet/adi/adin1110.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ static int adin1110_probe_netdevs(struct adin1110_priv *priv)
15991599
netdev->netdev_ops = &adin1110_netdev_ops;
16001600
netdev->ethtool_ops = &adin1110_ethtool_ops;
16011601
netdev->priv_flags |= IFF_UNICAST_FLT;
1602-
netdev->netns_local = true;
1602+
netdev->netns_immutable = true;
16031603

16041604
port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false);
16051605
if (IS_ERR(port_priv->phydev)) {

drivers/net/ethernet/marvell/prestera/prestera_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id)
634634
goto err_dl_port_register;
635635

636636
dev->features |= NETIF_F_HW_TC;
637-
dev->netns_local = true;
637+
dev->netns_immutable = true;
638638
dev->netdev_ops = &prestera_netdev_ops;
639639
dev->ethtool_ops = &prestera_ethtool_ops;
640640
SET_NETDEV_DEV(dev, sw->dev->dev);

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,9 +4423,9 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
44234423

44244424
if (mlx5e_is_uplink_rep(priv)) {
44254425
features = mlx5e_fix_uplink_rep_features(netdev, features);
4426-
netdev->netns_local = true;
4426+
netdev->netns_immutable = true;
44274427
} else {
4428-
netdev->netns_local = false;
4428+
netdev->netns_immutable = false;
44294429
}
44304430

44314431
mutex_unlock(&priv->state_lock);

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev,
905905

906906
netdev->features |= netdev->hw_features;
907907

908-
netdev->netns_local = true;
908+
netdev->netns_immutable = true;
909909
}
910910

911911
static int mlx5e_init_rep(struct mlx5_core_dev *mdev,

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u16 local_port,
15791579
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
15801580
dev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
15811581
dev->lltx = true;
1582-
dev->netns_local = true;
1582+
dev->netns_immutable = true;
15831583

15841584
dev->min_mtu = ETH_MIN_MTU;
15851585
dev->max_mtu = MLXSW_PORT_MAX_MTU - MLXSW_PORT_ETH_FRAME_HDR;

0 commit comments

Comments
 (0)