[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADxym3a2qsM_2s_thwv93QLr-KP4eDcqPaK6LPUGnhenraKZ_w@mail.gmail.com>
Date: Mon, 31 Oct 2022 11:08:19 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: kuba@...nel.org, davem@...emloft.net, pabeni@...hat.com,
yoshfuji@...ux-ipv6.org, dsahern@...nel.org, imagedong@...cent.com,
kafai@...com, asml.silence@...il.com, keescook@...omium.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/9] net: tcp: add 'drop_reason' field to struct tcp_skb_cb
Hello,
On Sat, Oct 29, 2022 at 11:23 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Sat, Oct 29, 2022 at 6:11 AM <menglong8.dong@...il.com> wrote:
> >
> > From: Menglong Dong <imagedong@...cent.com>
> >
> > Because of the long call chain on processing skb in TCP protocol, it's
> > hard to pass the drop reason to the code where the skb is freed.
> >
> > Therefore, we can store the drop reason to skb->cb, and pass it to
> > kfree_skb_reason(). I'm lucky, the struct tcp_skb_cb still has 4 bytes
> > spare space for this purpose.
>
> No, we have needs for this space for future use.
>
> skb->cb[] purpose is to store semi-permanent info, for skbs that stay
> in a queue.
>
May I use it for a while? Or, can I make it a union with
some field, such as 'header'? As the 'drop_reason' field will
be set only if it is going to be freed.
> Here, you need a state stored only in the context of the current context.
> Stack variables are better.
It's hard to get the drop reason through stack variables,
especially some functions in TCP protocol, such as:
tcp_rcv_synsent_state_process
tcp_timewait_state_process
tcp_conn_request
tcp_rcv_state_process
And it will mess the code a little up, just like what
you comment in this series:
https://lore.kernel.org/netdev/20220617100514.7230-1-imagedong@tencent.com/
I hope to complete this part, or I think I can't move
ahead :/
Thanks!
Menglong Dong
Powered by blists - more mailing lists