OSDN Git Service

gro: decrease size of CB
authorRichard Gobert <richardbgobert@gmail.com>
Thu, 1 Jun 2023 16:14:09 +0000 (18:14 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 Jun 2023 09:12:20 +0000 (11:12 +0200)
commit7b355b76e2b32cc516969c01984efdf49b11fc81
treec6bc8bd113c2703611609da8b42e888024d1ae0d
parentddb8701dcb67aff0155d507c63cb1e201daf3ad6
gro: decrease size of CB

The GRO control block (NAPI_GRO_CB) is currently at its maximum size.
This commit reduces its size by putting two groups of fields that are
used only at different times into a union.

Specifically, the fields frag0 and frag0_len are the fields that make up
the frag0 optimisation mechanism, which is used during the initial
parsing of the SKB.

The fields last and age are used after the initial parsing, while the
SKB is stored in the GRO list, waiting for other packets to arrive.

There was one location in dev_gro_receive that modified the frag0 fields
after setting last and age. I changed this accordingly without altering
the code behaviour.

Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230601161407.GA9253@debian
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/gro.h
net/core/gro.c