]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: gro: decouple GRO from the NAPI layer
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Tue, 25 Feb 2025 17:17:43 +0000 (18:17 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 27 Feb 2025 13:03:14 +0000 (14:03 +0100)
commit291515c7640962f8865e4c54897a5e91526b450c
tree3f375c3d6bf5bc00ebd42e9b61523418e1a2fc37
parent01358e8fe922f716c05d7864ac2213b2440026e7
net: gro: decouple GRO from the NAPI layer

In fact, these two are not tied closely to each other. The only
requirements to GRO are to use it in the BH context and have some
sane limits on the packet batches, e.g. NAPI has a limit of its
budget (64/8/etc.).
Move purely GRO fields into a new structure, &gro_node. Embed it
into &napi_struct and adjust all the references.
gro_node::cached_napi_id is effectively the same as
napi_struct::napi_id, but to be used on GRO hotpath to mark skbs.
napi_struct::napi_id is now a fully control path field.

Three Ethernet drivers use napi_gro_flush() not really meant to be
exported, so move it to <net/gro.h> and add that include there.
napi_gro_receive() is used in more than 100 drivers, keep it
in <linux/netdevice.h>.
This does not make GRO ready to use outside of the NAPI context
yet.

Tested-by: Daniel Xu <dxu@dxuuu.xyz>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/brocade/bna/bnad.c
drivers/net/ethernet/cortina/gemini.c
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
include/linux/netdevice.h
include/net/busy_poll.h
include/net/gro.h
net/core/dev.c
net/core/gro.c