Commit 05c1280a authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Paolo Abeni
Browse files

netdev_features: convert NETIF_F_NETNS_LOCAL to dev->netns_local



"Interface can't change network namespaces" is rather an attribute,
not a feature, and it can't be changed via Ethtool.
Make it a "cold" private flag instead of a netdev_feature and free
one more bit.

Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 00d066a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,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                                                     
struct_list_head                    net_notifier_list                                               
struct_macsec_ops*                  macsec_ops                                                      
struct_udp_tunnel_nic_info*         udp_tunnel_nic_info                                             
+0 −7
Original line number Diff line number Diff line
@@ -139,13 +139,6 @@ chained skbs (skb->next/prev list).
Features contained in NETIF_F_SOFT_FEATURES are features of networking
stack. Driver should not change behaviour based on them.

 * netns-local device

NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
network namespaces (e.g. loopback).

Don't use it in drivers.

 * VLAN challenged

NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
+2 −2
Original line number Diff line number Diff line
@@ -137,10 +137,10 @@ would be sub-port 0 on port 1 on switch 1.
Port Features
^^^^^^^^^^^^^

NETIF_F_NETNS_LOCAL
dev->netns_local

If the switchdev driver (and device) only supports offloading of the default
network namespace (netns), the driver should set this feature flag to prevent
network namespace (netns), the driver should set this private flag to prevent
the port netdev from being moved out of the default netns.  A netns-aware
driver/device would not set this flag and be responsible for partitioning
hardware to preserve netns containment.  This means hardware cannot forward
+1 −1
Original line number Diff line number Diff line
@@ -3099,8 +3099,8 @@ 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->features		|= NETIF_F_GSO_SOFTWARE;
	dev->features		|= NETIF_F_NETNS_LOCAL;
	dev->hw_features	|= NETIF_F_SG | NETIF_F_HW_CSUM;
	dev->hw_features	|= NETIF_F_FRAGLIST | NETIF_F_RXCSUM;
	dev->hw_features	|= NETIF_F_GSO_SOFTWARE;
+3 −3
Original line number Diff line number Diff line
@@ -5930,6 +5930,9 @@ void bond_setup(struct net_device *bond_dev)
	/* don't acquire bond device's netif_tx_lock when transmitting */
	bond_dev->lltx = true;

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

	/* By default, we declare the bond to be fully
	 * VLAN hardware accelerated capable. Special
	 * care is taken in the various xmit functions
@@ -5937,9 +5940,6 @@ void bond_setup(struct net_device *bond_dev)
	 * capable
	 */

	/* Don't allow bond devices to change network namespaces. */
	bond_dev->features |= NETIF_F_NETNS_LOCAL;

	bond_dev->hw_features = BOND_VLAN_FEATURES |
				NETIF_F_HW_VLAN_CTAG_RX |
				NETIF_F_HW_VLAN_CTAG_FILTER |
Loading