[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJO8jzjFWvJ610TPmKDE8WKi8ojTr_HWXLz5g=4pdQHEA@mail.gmail.com>
Date: Wed, 25 Aug 2021 08:47:46 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Zhongya Yan <yan2228598786@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>, netdev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
David Miller <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>, hengqi.chen@...il.com,
Yonghong Song <yhs@...com>
Subject: Re: [PATCH] net: tcp_drop adds `reason` parameter for tracing v2
On Wed, Aug 25, 2021 at 8:41 AM Zhongya Yan <yan2228598786@...il.com> wrote:
>
> In this version, fix and modify some code issues. Changed the reason for `tcp_drop` from an enumeration to a mask and enumeration usage in the trace output.
> By shifting `__LINE__` left by 6 bits to accommodate the `tcp_drop` call method source, 6 bits are enough to use. This allows for a more granular identification of the reason for calling `tcp_drop` without conflicts and essentially without overflow.
> Example.
> ```
...
*/
> @@ -5703,15 +5700,15 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
> TCP_INC_STATS(sock_net(sk), TCP_MIB_INERRS);
> NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNCHALLENGE);
> tcp_send_challenge_ack(sk, skb);
> - goto discard;
> + tcp_drop(sk, skb, TCP_DROP_MASK(__LINE__, TCP_VALIDATE_INCOMING));
I'd rather use a string. So that we can more easily identify _why_ the
packet was drop, without looking at the source code
of the exact kernel version to locate line number 1057
You can be sure that we will get reports in the future from users of
heavily modified kernels.
Having to download a git tree, or apply semi-private patches is a no go.
If you really want to include __FILE__ and __LINE__, these both can be
stringified and included in the report, with the help of macros.
Powered by blists - more mailing lists