Skip to content

net: adjust HW GRO and LRO feature handling

Jakub Kicinski bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8net: stop making HW-GRO depend on SW GROdrivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c drivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/qlogic/qede/qede_filter.c+2 -60 replies
2/8selftests: drv-net: drop the generic XDP hack from the HW GRO setuptools/testing/selftests/drivers/net/gro_lib.py tools/testing/selftests/drivers/net/hw/gro_stats.py+1 -381 reply
3/8net: state the "XDP excludes HW-GRO" rule in the coreDocumentation/networking/net_cachelines/net_device.rst include/linux/netdevice.h net/core/dev.c+81 -231 reply
4/8net: state the "XDP excludes LRO" rule in the coreinclude/linux/netdev_features.h net/core/dev.c+28 -141 reply
5/8eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handlingdrivers/net/ethernet/mellanox/mlx5/core/en_main.c+3 -291 reply
6/8eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_featuresdrivers/net/ethernet/broadcom/bnxt/bnxt.c+1 -10 replies
7/8eth: qede: drop the now-dead HW-GRO vs XDP handlingdrivers/net/ethernet/qlogic/qede/qede_filter.c drivers/net/ethernet/qlogic/qede/qede_main.c+2 -100 replies
8/8eth: gve: drop the now-dead HW-GRO vs XDP interlockdrivers/net/ethernet/google/gve/gve_main.c+0 -122 replies

Reviews trailers per patch

2 of 8 patches have a Reviewed-by or Acked-by.

PatchAnkit GargHarshitha RamamurthyWillem de Bruijn
1/8
2/8
3/8
4/8R-b
5/8
6/8
7/8
8/8R-b R-b

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-next 0/8] net: adjust HW GRO and LRO feature handling

XDP has no understanding of GSO frames. GSO frame looks to XDP like a large packet. Pushing / popping headers cannot be reflected in GSO metadata. XDP redirect is completely blind to GSO since struct xdp_frame carries no GSO fields.

For those reasons most (read: all well behaved?) drivers disable LRO and HW GRO when XDP is attached.

This series lifts the auto-clearing of HW-GRO and LRO from drivers up to netdev core. This gives us uniform behavior - previously some drivers would reject XDP attach w/ HW-GRO and others would auto- -clear the HW-GRO features.

More importantly (for me) after this series the HW-GRO/LRO features should consistently remain in wanted_features, and get re-enabled after XDP is detached. I started looking at this because XDP generic tests in NIPA unintentionally clear HW-GRO, which in turn makes devmem tests fail / skip on mlx5.

Note that XDP generic mangling GSO state is its own can of worms this series doesn't try to address. There are multiple paths (xdpgeneric, tun, veth...) which end up calling XDP on skbs, with varying level of assurance that the skb is not a GSO super-frame...

Jakub Kicinski (8):
net: stop making HW-GRO depend on SW GRO
selftests: drv-net: drop the generic XDP hack from the HW GRO setup
net: state the "XDP excludes HW-GRO" rule in the core
net: state the "XDP excludes LRO" rule in the core
eth: mlx5e: drop the now-dead HW-GRO and LRO vs XDP handling
eth: bnxt_en: don't clear HW-GRO and LRO for XDP in ndo_fix_features
eth: qede: drop the now-dead HW-GRO vs XDP handling
eth: gve: drop the now-dead HW-GRO vs XDP interlock

 .../networking/net_cachelines/net_device.rst  |   1 +
 include/linux/netdev_features.h               |   6 +
 include/linux/netdevice.h                     |   6 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   5 +-
 drivers/net/ethernet/google/gve/gve_main.c    |  12 --
 .../net/ethernet/mellanox/mlx5/core/en_main.c |  32 +-----
 .../net/ethernet/qlogic/qede/qede_filter.c    |  12 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c  |   1 -
 net/core/dev.c                                | 107 ++++++++++++++----
 .../testing/selftests/drivers/net/gro_lib.py  |  21 +---
 .../selftests/drivers/net/hw/gro_stats.py     |  18 ---
 12 files changed, 104 insertions(+), 119 deletions(-)
Signature · 1 line
2.56.1