Skip to content

veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled

Tianyi Gao bpf linux-kselftest netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2veth: schedule the peer's NAPI after XDP_TX when only GRO is enableddrivers/net/veth.c+1 -13 repliesApplied
2/2selftests: net: veth: test XDP_TX to a peer with GRO enabledtools/testing/selftests/net/lib/xdp_dummy.bpf.c tools/testing/selftests/net/veth.sh+31 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMohsin BashirLorenzo BianconiJesper Dangaard Brouer
1/2R-b A-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH net 0/2] veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled

When an XDP program on a veth device returns XDP_TX and the peer has GRO enabled but no XDP program, the frames are queued on the peer's ring, but the peer's NAPI is never scheduled to process them. Once the ring is full, every XDP_TX frame is dropped.

Commit 0e672f306a28 ("veth: check for NAPI instead of xdp_prog before xmit of XDP frame") made such a peer work as an XDP_REDIRECT target, where veth_xdp_xmit() both queues the frames and schedules the peer's NAPI. XDP_TX queues its frames through the same function but schedules the NAPI in veth_xdp_flush(), which still checks xdp_prog.

The usual workaround is to load a dummy XDP program on the peer [1]. That turns off TSO on the device, and every skb it sends then goes through the peer's XDP path, where most of them are copied. In our tests, TCP sent from a namespace dropped from 22.1 to 14.8 Gbit/s with the dummy program. With this fix the program is no longer needed.

Patch 1 makes veth_xdp_flush() check the peer's napi pointer, as veth_xdp_xmit() does. Patch 2 adds a test for this case to veth.sh.

[1] https://lore.kernel.org/all/[email protected]/

---
Bochao Cao's migration of the XDP feature test [2] skips XDP_TX on veth when the peer has no XDP program, which is the case patch 1 fixes.

[2] https://lore.kernel.org/netdev/[email protected]/

Tianyi Gao (2):
veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled
selftests: net: veth: test XDP_TX to a peer with GRO enabled

 drivers/net/veth.c                            |  2 +-
 .../testing/selftests/net/lib/xdp_dummy.bpf.c |  6 +++++
 tools/testing/selftests/net/veth.sh           | 25 +++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

base-commit: 513444cc62e231a11c9b15ea88de0890da9b2b4f

Signature · 1 line
2.55.0