Commit 00d066a4 authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Paolo Abeni
Browse files

netdev_features: convert NETIF_F_LLTX to dev->lltx



NETIF_F_LLTX can't be changed via Ethtool and is not a feature,
rather an attribute, very similar to IFF_NO_QUEUE (and hot).
Free one netdev_features_t bit and make it a "hot" private flag.

Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent beb5a9be
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ net_device struct fast path usage breakdown
Type                                Name                    fastpath_tx_access  fastpath_rx_access  Comments
..struct                            ..net_device                                                    
unsigned_long:32                    priv_flags              read_mostly         -                   __dev_queue_xmit(tx)
unsigned_long:1                     lltx                    read_mostly         -                   HARD_TX_LOCK,HARD_TX_TRYLOCK,HARD_TX_UNLOCK(tx)
char                                name[16]                -                   -                   
struct_netdev_name_node*            name_node                                                       
struct_dev_ifalias*                 ifalias                                                         
+0 −8
Original line number Diff line number Diff line
@@ -139,14 +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.

 * LLTX driver (deprecated for hardware drivers)

NETIF_F_LLTX is meant to be used by drivers that don't need locking at all,
e.g. software tunnels.

This is also used in a few legacy drivers that implement their
own locking, don't use it for new (hardware) drivers.

 * netns-local device

NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
+2 −2
Original line number Diff line number Diff line
@@ -258,11 +258,11 @@ ndo_get_stats:
ndo_start_xmit:
	Synchronization: __netif_tx_lock spinlock.

	When the driver sets NETIF_F_LLTX in dev->features this will be
	When the driver sets dev->lltx this will be
	called without holding netif_tx_lock. In this case the driver
	has to lock by itself when needed.
	The locking there should also properly protect against
	set_rx_mode. WARNING: use of NETIF_F_LLTX is deprecated.
	set_rx_mode. WARNING: use of dev->lltx is deprecated.
	Don't use it for new drivers.

	Context: Process with BHs disabled or BH (timer),
+1 −1
Original line number Diff line number Diff line
@@ -3098,7 +3098,7 @@ static void amt_link_setup(struct net_device *dev)
	dev->hard_header_len	= 0;
	dev->addr_len		= 0;
	dev->priv_flags		|= IFF_NO_QUEUE;
	dev->features		|= NETIF_F_LLTX;
	dev->lltx		= true;
	dev->features		|= NETIF_F_GSO_SOFTWARE;
	dev->features		|= NETIF_F_NETNS_LOCAL;
	dev->hw_features	|= NETIF_F_SG | NETIF_F_HW_CSUM;
+1 −1
Original line number Diff line number Diff line
@@ -553,7 +553,6 @@ static void bareudp_setup(struct net_device *dev)
	SET_NETDEV_DEVTYPE(dev, &bareudp_type);
	dev->features    |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
	dev->features    |= NETIF_F_RXCSUM;
	dev->features    |= NETIF_F_LLTX;
	dev->features    |= NETIF_F_GSO_SOFTWARE;
	dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
	dev->hw_features |= NETIF_F_RXCSUM;
@@ -566,6 +565,7 @@ static void bareudp_setup(struct net_device *dev)
	dev->type = ARPHRD_NONE;
	netif_keep_dst(dev);
	dev->priv_flags |= IFF_NO_QUEUE;
	dev->lltx = true;
	dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
	dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
}
Loading