From: Simon Horman <simon.horman@corigine.com>
To: Richard Gobert <richardbgobert@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, lixiaoyan@google.com, alexanderduyck@fb.com,
linyunsheng@huawei.com, lucien.xin@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] gro: decrease size of CB
Date: Tue, 30 May 2023 13:59:20 +0200 [thread overview]
Message-ID: <ZHXlGH2YqVnO6KYq@corigine.com> (raw)
In-Reply-To: <20230529161240.GA3958@debian>
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@gmail.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;
...
prev parent reply other threads:[~2023-05-30 12:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 16:05 [PATCH 0/1] " Richard Gobert
2023-05-29 16:12 ` [PATCH 1/1] " Richard Gobert
2023-05-30 11:59 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZHXlGH2YqVnO6KYq@corigine.com \
--to=simon.horman@corigine.com \
--cc=alexanderduyck@fb.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=lixiaoyan@google.com \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardbgobert@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®