[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZHXlGH2YqVnO6KYq@corigine.com>
Date: Tue, 30 May 2023 13:59:20 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Richard Gobert <richardbgobert@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, lixiaoyan@...gle.com, alexanderduyck@...com,
linyunsheng@...wei.com, lucien.xin@...il.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] gro: decrease size of CB
On Mon, May 29, 2023 at 06:12:42PM +0200, Richard Gobert wrote:
> 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@...il.com>
...
> diff --git a/net/core/gro.c b/net/core/gro.c
> index 2d84165cb4f1..91454176a6d8 100644
> --- a/net/core/gro.c
> +++ b/net/core/gro.c
> @@ -460,6 +460,14 @@ static void gro_pull_from_frag0(struct sk_buff *skb, int grow)
> }
> }
>
> +static inline void gro_try_pull_from_frag0(struct sk_buff *skb)
Hi Richard,
In general it is preferred not to use the inline keyword in C files,
but rather let the compiler do it's thing.
Unless you think the compiler isn't doing it's thing very well
in this case, please consider removing the inline keyword.
> +{
> + int grow = skb_gro_offset(skb) - skb_headlen(skb);
> +
> + if (grow > 0)
> + gro_pull_from_frag0(skb, grow);
> +}
> +
> static void gro_flush_oldest(struct napi_struct *napi, struct list_head *head)
> {
> struct sk_buff *oldest;
...
Powered by blists - more mailing lists