Skip to content

Commit 710ad98

Browse files
borkmanndavem330
authored andcommitted
veth: Do not record rx queue hint in veth_xmit
Laurent reported that they have seen a significant amount of TCP retransmissions at high throughput from applications residing in network namespaces talking to the outside world via veths. The drops were seen on the qdisc layer (fq_codel, as per systemd default) of the phys device such as ena or virtio_net due to all traffic hitting a _single_ TX queue _despite_ multi-queue device. (Note that the setup was _not_ using XDP on veths as the issue is generic.) More specifically, after edbea92 ("veth: Store queue_mapping independently of XDP prog presence") which made it all the way back to v4.19.184+, skb_record_rx_queue() would set skb->queue_mapping to 1 (given 1 RX and 1 TX queue by default for veths) instead of leaving at 0. This is eventually retained and callbacks like ena_select_queue() will also pick single queue via netdev_core_pick_tx()'s ndo_select_queue() once all the traffic is forwarded to that device via upper stack or other means. Similarly, for others not implementing ndo_select_queue() if XPS is disabled, netdev_pick_tx() might call into the skb_tx_hash() and check for prior skb_rx_queue_recorded() as well. In general, it is a _bad_ idea for virtual devices like veth to mess around with queue selection [by default]. Given dev->real_num_tx_queues is by default 1, the skb->queue_mapping was left untouched, and so prior to edbea92 the netdev_core_pick_tx() could do its job upon __dev_queue_xmit() on the phys device. Unbreak this and restore prior behavior by removing the skb_record_rx_queue() from veth_xmit() altogether. If the veth peer has an XDP program attached, then it would return the first RX queue index in xdp_md->rx_queue_index (unless configured in non-default manner). However, this is still better than breaking the generic case. Fixes: edbea92 ("veth: Store queue_mapping independently of XDP prog presence") Fixes: 638264d ("veth: Support per queue XDP ring") Reported-by: Laurent Bernaille <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Cc: Maciej Fijalkowski <[email protected]> Cc: Toshiaki Makita <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: John Fastabend <[email protected]> Cc: Willem de Bruijn <[email protected]> Acked-by: John Fastabend <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Acked-by: Toshiaki Makita <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c288bc0 commit 710ad98

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/net/veth.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
335335
*/
336336
use_napi = rcu_access_pointer(rq->napi) &&
337337
veth_skb_is_eligible_for_gro(dev, rcv, skb);
338-
skb_record_rx_queue(skb, rxq);
339338
}
340339

341340
skb_tx_timestamp(skb);

0 commit comments

Comments
 (0)