Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0cdf76c authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller
Browse files

net: remove NETDEV_TX_LOCKED support



No more users in the tree, remove NETDEV_TX_LOCKED support.
Adds another hole in softnet_stats struct, but better than keeping
the unused collision counter around.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6086a89
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -131,13 +131,11 @@ stack. Driver should not change behaviour based on them.

 * LLTX driver (deprecated for hardware drivers)

NETIF_F_LLTX should be set in drivers that implement their own locking in
transmit path or don't need locking at all (e.g. software tunnels).
In ndo_start_xmit, it is recommended to use a try_lock and return
NETDEV_TX_LOCKED when the spin lock fails.  The locking should also properly
protect against other callbacks (the rules you need to find out).
NETIF_F_LLTX is meant to be used by drivers that don't need locking at all,
e.g. software tunnels.

Don't use it for new drivers.
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

+3 −6
Original line number Diff line number Diff line
@@ -69,10 +69,9 @@ ndo_start_xmit:

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

	Context: Process with BHs disabled or BH (timer),
@@ -83,8 +82,6 @@ ndo_start_xmit:
	o NETDEV_TX_BUSY Cannot transmit packet, try later 
	  Usually a bug, means queue start/stop flow control is broken in
	  the driver. Note: the driver must NOT put the skb in its DMA ring.
	o NETDEV_TX_LOCKED Locking failed, please retry quickly.
	  Only valid when NETIF_F_LLTX is set.

ndo_tx_timeout:
	Synchronization: netif_tx_lock spinlock; all TX queues frozen.
+0 −3
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ enum netdev_tx {
	__NETDEV_TX_MIN	 = INT_MIN,	/* make sure enum is signed */
	NETDEV_TX_OK	 = 0x00,	/* driver took care of packet */
	NETDEV_TX_BUSY	 = 0x10,	/* driver tx path was busy*/
	NETDEV_TX_LOCKED = 0x20,	/* driver tx lock was already taken */
};
typedef enum netdev_tx netdev_tx_t;

@@ -831,7 +830,6 @@ struct tc_to_netdev {
 *	the queue before that can happen; it's for obsolete devices and weird
 *	corner cases, but the stack really does a non-trivial amount
 *	of useless work if you return NETDEV_TX_BUSY.
 *        (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
 *	Required; cannot be NULL.
 *
 * netdev_features_t (*ndo_fix_features)(struct net_device *dev,
@@ -2737,7 +2735,6 @@ struct softnet_data {
	/* stats */
	unsigned int		processed;
	unsigned int		time_squeeze;
	unsigned int		cpu_collision;
	unsigned int		received_rps;
#ifdef CONFIG_RPS
	struct softnet_data	*rps_ipi_list;
+2 −1
Original line number Diff line number Diff line
@@ -162,7 +162,8 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
		   sd->processed, sd->dropped, sd->time_squeeze, 0,
		   0, 0, 0, 0, /* was fastroute */
		   sd->cpu_collision, sd->received_rps, flow_limit_count);
		   0,	/* was cpu_collision */
		   sd->received_rps, flow_limit_count);
	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -3472,7 +3472,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
				     pkt_dev->odevname, ret);
		pkt_dev->errors++;
		/* fallthru */
	case NETDEV_TX_LOCKED:
	case NETDEV_TX_BUSY:
		/* Retry it next time */
		atomic_dec(&(pkt_dev->skb->users));
Loading