mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
veth: wake a stopped peer txq beyond real_num_tx_queues
Since commitdc82a33297("veth: apply qdisc backpressure on full ptr_ring to reduce TX drops"), only the peer's veth_poll() wakes a txq that veth_xmit() stopped on a full ptr_ring. veth_poll() skips txqs at or above the peer's real_num_tx_queues. If the peer shrinks its TX channels while such a txq is stopped, nothing wakes it. netif_set_real_num_tx_queues() keeps its state, so once the channels are grown back, its first skb is requeued forever. With a single root qdisc this blocks all transmission of the device. Look the txq up below num_tx_queues instead. Waking a txq that is not in use is harmless. Reproduced in virtme-ng with a UDP flood from veth0 into veth1, which has GRO, while switching veth0 between one and two TX channels: without this patch veth0 stopped transmitting within 11 cycles in 3 of 3 runs, with it veth0 kept transmitting through 30 cycles in 3 of 3 runs. Fixes:08f566e8f8("veth: fix OOB txq access in veth_poll() with asymmetric queue counts") Signed-off-by: Simon Schippers <[email protected]> Reviewed-by: Tianyi Gao <[email protected]> Tested-by: Tianyi Gao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
This commit is contained in:
committed by
Paolo Abeni
parent
e203d8a475
commit
8a0b03058f
+1
-1
@@ -984,7 +984,7 @@ static int veth_poll(struct napi_struct *napi, int budget)
|
||||
|
||||
/* NAPI functions as RCU section */
|
||||
peer_dev = rcu_dereference_check(priv->peer, rcu_read_lock_bh_held());
|
||||
peer_txq = (peer_dev && queue_idx < peer_dev->real_num_tx_queues) ?
|
||||
peer_txq = (peer_dev && queue_idx < peer_dev->num_tx_queues) ?
|
||||
netdev_get_tx_queue(peer_dev, queue_idx) : NULL;
|
||||
|
||||
xdp_set_return_frame_no_direct();
|
||||
|
||||
Reference in New Issue
Block a user