Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: rename netns_local to netns_immutable

The name 'netns_local' is confusing. A following commit will export it via
netlink, so let's use a more explicit name.

Reported-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Nicolas Dichtel and committed by
Paolo Abeni
0c493da8 af08cc40

+42 -42
+1 -1
Documentation/networking/net_cachelines/net_device.rst
··· 167 167 unsigned:1 threaded napi_poll(napi_enable,dev_set_threaded) 168 168 unsigned_long:1 see_all_hwtstamp_requests 169 169 unsigned_long:1 change_proto_down 170 - unsigned_long:1 netns_local 170 + unsigned_long:1 netns_immutable 171 171 unsigned_long:1 fcoe_mtu 172 172 struct list_head net_notifier_list 173 173 struct macsec_ops* macsec_ops
+1 -1
Documentation/networking/switchdev.rst
··· 137 137 Port Features 138 138 ^^^^^^^^^^^^^ 139 139 140 - dev->netns_local 140 + dev->netns_immutable 141 141 142 142 If the switchdev driver (and device) only supports offloading of the default 143 143 network namespace (netns), the driver should set this private flag to prevent
+1 -1
drivers/net/amt.c
··· 3099 3099 dev->addr_len = 0; 3100 3100 dev->priv_flags |= IFF_NO_QUEUE; 3101 3101 dev->lltx = true; 3102 - dev->netns_local = true; 3102 + dev->netns_immutable = true; 3103 3103 dev->features |= NETIF_F_GSO_SOFTWARE; 3104 3104 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM; 3105 3105 dev->hw_features |= NETIF_F_FRAGLIST | NETIF_F_RXCSUM;
+1 -1
drivers/net/bonding/bond_main.c
··· 6025 6025 bond_dev->lltx = true; 6026 6026 6027 6027 /* Don't allow bond devices to change network namespaces. */ 6028 - bond_dev->netns_local = true; 6028 + bond_dev->netns_immutable = true; 6029 6029 6030 6030 /* By default, we declare the bond to be fully 6031 6031 * VLAN hardware accelerated capable. Special
+1 -1
drivers/net/ethernet/adi/adin1110.c
··· 1599 1599 netdev->netdev_ops = &adin1110_netdev_ops; 1600 1600 netdev->ethtool_ops = &adin1110_ethtool_ops; 1601 1601 netdev->priv_flags |= IFF_UNICAST_FLT; 1602 - netdev->netns_local = true; 1602 + netdev->netns_immutable = true; 1603 1603 1604 1604 port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false); 1605 1605 if (IS_ERR(port_priv->phydev)) {
+1 -1
drivers/net/ethernet/marvell/prestera/prestera_main.c
··· 634 634 goto err_dl_port_register; 635 635 636 636 dev->features |= NETIF_F_HW_TC; 637 - dev->netns_local = true; 637 + dev->netns_immutable = true; 638 638 dev->netdev_ops = &prestera_netdev_ops; 639 639 dev->ethtool_ops = &prestera_ethtool_ops; 640 640 SET_NETDEV_DEV(dev, sw->dev->dev);
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 4423 4423 4424 4424 if (mlx5e_is_uplink_rep(priv)) { 4425 4425 features = mlx5e_fix_uplink_rep_features(netdev, features); 4426 - netdev->netns_local = true; 4426 + netdev->netns_immutable = true; 4427 4427 } else { 4428 - netdev->netns_local = false; 4428 + netdev->netns_immutable = false; 4429 4429 } 4430 4430 4431 4431 mutex_unlock(&priv->state_lock);
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
··· 905 905 906 906 netdev->features |= netdev->hw_features; 907 907 908 - netdev->netns_local = true; 908 + netdev->netns_immutable = true; 909 909 } 910 910 911 911 static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
+1 -1
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 1579 1579 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1580 1580 dev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1581 1581 dev->lltx = true; 1582 - dev->netns_local = true; 1582 + dev->netns_immutable = true; 1583 1583 1584 1584 dev->min_mtu = ETH_MIN_MTU; 1585 1585 dev->max_mtu = MLXSW_PORT_MAX_MTU - MLXSW_PORT_ETH_FRAME_HDR;
+1 -1
drivers/net/ethernet/rocker/rocker_main.c
··· 2576 2576 rocker_carrier_init(rocker_port); 2577 2577 2578 2578 dev->features |= NETIF_F_SG; 2579 - dev->netns_local = true; 2579 + dev->netns_immutable = true; 2580 2580 2581 2581 /* MTU range: 68 - 9000 */ 2582 2582 dev->min_mtu = ROCKER_PORT_MIN_MTU;
+1 -1
drivers/net/ethernet/ti/cpsw_new.c
··· 1409 1409 1410 1410 ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | 1411 1411 NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_TC; 1412 - ndev->netns_local = true; 1412 + ndev->netns_immutable = true; 1413 1413 1414 1414 ndev->xdp_features = NETDEV_XDP_ACT_BASIC | 1415 1415 NETDEV_XDP_ACT_REDIRECT |
+1 -1
drivers/net/loopback.c
··· 172 172 dev->flags = IFF_LOOPBACK; 173 173 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; 174 174 dev->lltx = true; 175 - dev->netns_local = true; 175 + dev->netns_immutable = true; 176 176 netif_keep_dst(dev); 177 177 dev->hw_features = NETIF_F_GSO_SOFTWARE; 178 178 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
+1 -1
drivers/net/net_failover.c
··· 734 734 failover_dev->lltx = true; 735 735 736 736 /* Don't allow failover devices to change network namespaces. */ 737 - failover_dev->netns_local = true; 737 + failover_dev->netns_immutable = true; 738 738 739 739 failover_dev->hw_features = FAILOVER_VLAN_FEATURES | 740 740 NETIF_F_HW_VLAN_CTAG_TX |
+1 -1
drivers/net/team/team_core.c
··· 2203 2203 dev->lltx = true; 2204 2204 2205 2205 /* Don't allow team devices to change network namespaces. */ 2206 - dev->netns_local = true; 2206 + dev->netns_immutable = true; 2207 2207 2208 2208 dev->features |= NETIF_F_GRO; 2209 2209
+1 -1
drivers/net/vrf.c
··· 1617 1617 dev->lltx = true; 1618 1618 1619 1619 /* don't allow vrf devices to change network namespaces. */ 1620 - dev->netns_local = true; 1620 + dev->netns_immutable = true; 1621 1621 1622 1622 /* does not make sense for a VLAN to be added to a vrf device */ 1623 1623 dev->features |= NETIF_F_VLAN_CHALLENGED;
+2 -2
include/linux/netdevice.h
··· 2021 2021 * regardless of source, even if those aren't 2022 2022 * HWTSTAMP_SOURCE_NETDEV 2023 2023 * @change_proto_down: device supports setting carrier via IFLA_PROTO_DOWN 2024 - * @netns_local: interface can't change network namespaces 2024 + * @netns_immutable: interface can't change network namespaces 2025 2025 * @fcoe_mtu: device supports maximum FCoE MTU, 2158 bytes 2026 2026 * 2027 2027 * @net_notifier_list: List of per-net netdev notifier block ··· 2429 2429 /* priv_flags_slow, ungrouped to save space */ 2430 2430 unsigned long see_all_hwtstamp_requests:1; 2431 2431 unsigned long change_proto_down:1; 2432 - unsigned long netns_local:1; 2432 + unsigned long netns_immutable:1; 2433 2433 unsigned long fcoe_mtu:1; 2434 2434 2435 2435 struct list_head net_notifier_list;
+1 -1
net/batman-adv/soft-interface.c
··· 1037 1037 dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 1038 1038 dev->priv_flags |= IFF_NO_QUEUE; 1039 1039 dev->lltx = true; 1040 - dev->netns_local = true; 1040 + dev->netns_immutable = true; 1041 1041 1042 1042 /* can't call min_mtu, because the needed variables 1043 1043 * have not been initialized yet
+1 -1
net/bridge/br_device.c
··· 488 488 SET_NETDEV_DEVTYPE(dev, &br_type); 489 489 dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE; 490 490 dev->lltx = true; 491 - dev->netns_local = true; 491 + dev->netns_immutable = true; 492 492 493 493 dev->features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 494 494 NETIF_F_HW_VLAN_STAG_TX;
+2 -2
net/core/dev.c
··· 12151 12151 12152 12152 /* Don't allow namespace local devices to be moved. */ 12153 12153 err = -EINVAL; 12154 - if (dev->netns_local) 12154 + if (dev->netns_immutable) 12155 12155 goto out; 12156 12156 12157 12157 /* Ensure the device has been registered */ ··· 12533 12533 char fb_name[IFNAMSIZ]; 12534 12534 12535 12535 /* Ignore unmoveable devices (i.e. loopback) */ 12536 - if (dev->netns_local) 12536 + if (dev->netns_immutable) 12537 12537 continue; 12538 12538 12539 12539 /* Leave virtual devices for the generic cleanup */
+1 -1
net/hsr/hsr_device.c
··· 643 643 /* Not sure about this. Taken from bridge code. netdevice.h says 644 644 * it means "Does not change network namespaces". 645 645 */ 646 - dev->netns_local = true; 646 + dev->netns_immutable = true; 647 647 648 648 dev->needs_free_netdev = true; 649 649
+1 -1
net/ieee802154/6lowpan/core.c
··· 116 116 ldev->netdev_ops = &lowpan_netdev_ops; 117 117 ldev->header_ops = &lowpan_header_ops; 118 118 ldev->needs_free_netdev = true; 119 - ldev->netns_local = true; 119 + ldev->netns_immutable = true; 120 120 } 121 121 122 122 static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[],
+5 -5
net/ieee802154/core.c
··· 226 226 list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) { 227 227 if (!wpan_dev->netdev) 228 228 continue; 229 - wpan_dev->netdev->netns_local = false; 229 + wpan_dev->netdev->netns_immutable = false; 230 230 err = dev_change_net_namespace(wpan_dev->netdev, net, "wpan%d"); 231 231 if (err) 232 232 break; 233 - wpan_dev->netdev->netns_local = true; 233 + wpan_dev->netdev->netns_immutable = true; 234 234 } 235 235 236 236 if (err) { ··· 242 242 list) { 243 243 if (!wpan_dev->netdev) 244 244 continue; 245 - wpan_dev->netdev->netns_local = false; 245 + wpan_dev->netdev->netns_immutable = false; 246 246 err = dev_change_net_namespace(wpan_dev->netdev, net, 247 247 "wpan%d"); 248 248 WARN_ON(err); 249 - wpan_dev->netdev->netns_local = true; 249 + wpan_dev->netdev->netns_immutable = true; 250 250 } 251 251 252 252 return err; ··· 291 291 switch (state) { 292 292 /* TODO NETDEV_DEVTYPE */ 293 293 case NETDEV_REGISTER: 294 - dev->netns_local = true; 294 + dev->netns_immutable = true; 295 295 wpan_dev->identifier = ++rdev->wpan_dev_id; 296 296 list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list); 297 297 rdev->devlist_generation++;
+1 -1
net/ipv4/ip_tunnel.c
··· 1162 1162 * Allowing to move it to another netns is clearly unsafe. 1163 1163 */ 1164 1164 if (!IS_ERR(itn->fb_tunnel_dev)) { 1165 - itn->fb_tunnel_dev->netns_local = true; 1165 + itn->fb_tunnel_dev->netns_immutable = true; 1166 1166 itn->fb_tunnel_dev->mtu = ip_tunnel_bind_dev(itn->fb_tunnel_dev); 1167 1167 ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev)); 1168 1168 itn->type = itn->fb_tunnel_dev->type;
+1 -1
net/ipv4/ipmr.c
··· 563 563 dev->flags = IFF_NOARP; 564 564 dev->netdev_ops = &reg_vif_netdev_ops; 565 565 dev->needs_free_netdev = true; 566 - dev->netns_local = true; 566 + dev->netns_immutable = true; 567 567 } 568 568 569 569 static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt)
+1 -1
net/ipv6/ip6_gre.c
··· 1620 1620 /* FB netdevice is special: we have one, and only one per netns. 1621 1621 * Allowing to move it to another netns is clearly unsafe. 1622 1622 */ 1623 - ign->fb_tunnel_dev->netns_local = true; 1623 + ign->fb_tunnel_dev->netns_immutable = true; 1624 1624 1625 1625 ip6gre_fb_tunnel_init(ign->fb_tunnel_dev); 1626 1626 ign->fb_tunnel_dev->rtnl_link_ops = &ip6gre_link_ops;
+1 -1
net/ipv6/ip6_tunnel.c
··· 2265 2265 /* FB netdevice is special: we have one, and only one per netns. 2266 2266 * Allowing to move it to another netns is clearly unsafe. 2267 2267 */ 2268 - ip6n->fb_tnl_dev->netns_local = true; 2268 + ip6n->fb_tnl_dev->netns_immutable = true; 2269 2269 2270 2270 err = ip6_fb_tnl_dev_init(ip6n->fb_tnl_dev); 2271 2271 if (err < 0)
+1 -1
net/ipv6/ip6mr.c
··· 668 668 dev->flags = IFF_NOARP; 669 669 dev->netdev_ops = &reg_vif_netdev_ops; 670 670 dev->needs_free_netdev = true; 671 - dev->netns_local = true; 671 + dev->netns_immutable = true; 672 672 } 673 673 674 674 static struct net_device *ip6mr_reg_vif(struct net *net, struct mr_table *mrt)
+1 -1
net/ipv6/sit.c
··· 1859 1859 /* FB netdevice is special: we have one, and only one per netns. 1860 1860 * Allowing to move it to another netns is clearly unsafe. 1861 1861 */ 1862 - sitn->fb_tunnel_dev->netns_local = true; 1862 + sitn->fb_tunnel_dev->netns_immutable = true; 1863 1863 1864 1864 t = netdev_priv(sitn->fb_tunnel_dev); 1865 1865 t->net = net;
+1 -1
net/openvswitch/vport-internal_dev.c
··· 149 149 150 150 /* Restrict bridge port to current netns. */ 151 151 if (vport->port_no == OVSP_LOCAL) 152 - vport->dev->netns_local = true; 152 + vport->dev->netns_immutable = true; 153 153 154 154 rtnl_lock(); 155 155 err = register_netdevice(vport->dev);
+5 -5
net/wireless/core.c
··· 162 162 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { 163 163 if (!wdev->netdev) 164 164 continue; 165 - wdev->netdev->netns_local = false; 165 + wdev->netdev->netns_immutable = false; 166 166 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); 167 167 if (err) 168 168 break; 169 - wdev->netdev->netns_local = true; 169 + wdev->netdev->netns_immutable = true; 170 170 } 171 171 172 172 if (err) { ··· 178 178 list) { 179 179 if (!wdev->netdev) 180 180 continue; 181 - wdev->netdev->netns_local = false; 181 + wdev->netdev->netns_immutable = false; 182 182 err = dev_change_net_namespace(wdev->netdev, net, 183 183 "wlan%d"); 184 184 WARN_ON(err); 185 - wdev->netdev->netns_local = true; 185 + wdev->netdev->netns_immutable = true; 186 186 } 187 187 188 188 return err; ··· 1513 1513 SET_NETDEV_DEVTYPE(dev, &wiphy_type); 1514 1514 wdev->netdev = dev; 1515 1515 /* can only change netns with wiphy */ 1516 - dev->netns_local = true; 1516 + dev->netns_immutable = true; 1517 1517 1518 1518 cfg80211_init_wdev(wdev); 1519 1519 break;
+1 -1
tools/testing/selftests/net/forwarding/README
··· 6 6 7 7 Unfortunately, these namespaces can not be used with actual switching 8 8 ASICs, as their ports can not be migrated to other network namespaces 9 - (dev->netns_local) and most of them probably do not support the 9 + (dev->netns_immutable) and most of them probably do not support the 10 10 L1-separation provided by namespaces. 11 11 12 12 However, a similar kind of flexibility can be achieved by using VRFs and