Skip to content

net: fix a couple of problems with XDP and bonding

Jakub Kicinski bpf linux-kselftest netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: record XDP programs propagated to lower devicesdrivers/net/bonding/bond_main.c include/linux/netdevice.h net/core/dev.c+81 -311 reply
2/5netdevsim: add ndo_xdp_xmitdrivers/net/netdevsim/netdev.c+20 -01 reply
3/5selftests: drv-net: check tcp-data-split against an already attached XDPtools/testing/selftests/drivers/net/config tools/testing/selftests/drivers/net/hds.py+66 -01 reply
4/5selftests/bpf: check XDP attach on a nested bond slavetools/testing/selftests/bpf/prog_tests/xdp_bonding.c+16 -21 reply
5/5net: drop GSO skbs instead of handing them to XDPdrivers/net/veth.c include/net/xdp.h net/core/dev.c+23 -01 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchStanislav Fomichev
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/5] net: fix a couple of problems with XDP and bonding

I started looking at untangling XDP vs HW-GRO story because of mlx5. mlx5 requires HW-GRO for HDS/memory providers. But generic XDP clears HW-GRO enablement completely. This is annoying in NIPA but also, from past experience with XDP changing ring geometry and IRQ mapping, it will also be annoying in production.

My plan / hope is to make generic XDP attachment leave HW-GRO in wanted features, that way it comes back after XDP is removed, making NIPA happy. This also simplifies the drivers slightly, as they no longer have to check XDP vs HW-GRO locally.

This is the most important part, I think - I would like to make the claim that HW-GRO and XDP are incompatible (today). Most drivers seem to agree, but IDPF allows XDP and HW-GRO to coexist. XDP can't carry the GRO/GSO state so changing the packet or trying to send it out would probably end badly. We should explicitly clear HW-GRO when XDP is attached in the core, until we have an understanding of how they would work together, and appropriate tests.

Please comment if you have opinion on the HW-GRO+XDP in general, that said, this series is just prep around bonding. What I described above will come next.

This series tries to shore up the gaps in XDP propagation. bonding bypasses the XDP program accounting in net_device so all the checks on control path trying to avoid enabling features incompatible with XDP are moot (e.g. we can have XDP+memory providers). First patch fixes the accounting (next 3 patches add tests).

Last patch makes us drop GSO packets if they reach XDP. I can't come up with a clean way of stopping GRO from working on lower when upper has generic XDP, so let's just drop the packets. I don't think generic XDP is worth the effort, users can disable GRO themselves if they really care.

All the issues here were discovered while working another series, but they were reproduced and tested with the selftests included.

Jakub Kicinski (5):
net: record XDP programs propagated to lower devices
netdevsim: add ndo_xdp_xmit
selftests: drv-net: check tcp-data-split against an already attached
XDP
selftests/bpf: check XDP attach on a nested bond slave
net: drop GSO skbs instead of handing them to XDP

 include/linux/netdevice.h                     |   7 ++
 include/net/xdp.h                             |  16 +++
 drivers/net/bonding/bond_main.c               |   4 +-
 drivers/net/netdevsim/netdev.c                |  20 ++++
 drivers/net/veth.c                            |   3 +
 net/core/dev.c                                | 105 +++++++++++++-----
 .../selftests/bpf/prog_tests/xdp_bonding.c    |  18 ++-
 tools/testing/selftests/drivers/net/config    |   1 +
 tools/testing/selftests/drivers/net/hds.py    |  65 +++++++++++
 9 files changed, 206 insertions(+), 33 deletions(-)
Signature · 1 line
2.55.0