[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210824072049.76789bba@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 24 Aug 2021 07:20:49 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Zhongya Yan <yan2228598786@...il.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
edumazet@...gle.com, rostedt@...dmis.org, mingo@...hat.com,
davem@...emloft.net, yoshfuji@...ux-ipv6.org, dsahern@...nel.org,
hengqi.chen@...il.com, yhs@...com
Subject: Re: [PATCH] net: tcp_drop adds `reason` parameter for tracing
On Tue, 24 Aug 2021 05:51:40 -0700 Zhongya Yan wrote:
> +enum tcp_drop_reason {
> + TCP_OFO_QUEUE = 1,
> + TCP_DATA_QUEUE_OFO = 2,
> + TCP_DATA_QUEUE = 3,
> + TCP_PRUNE_OFO_QUEUE = 4,
> + TCP_VALIDATE_INCOMING = 5,
> + TCP_RCV_ESTABLISHED = 6,
> + TCP_RCV_SYNSENT_STATE_PROCESS = 7,
> + TCP_RCV_STATE_PROCESS = 8
> +};
This is basically tracking the caller, each may have multiple reasons
for dropping. Is tracking the caller sufficient? Should we at least
make this a bitmask so we can set multiple bits (caller and more
precise reason)? Or are we going to add another field in that case?
> -static void tcp_drop(struct sock *sk, struct sk_buff *skb)
> +static void __tcp_drop(struct sock *sk,
> + struct sk_buff *skb)
> {
> sk_drops_add(sk, skb);
> __kfree_skb(skb);
> }
Why keep this function if there is only one caller?
> +/* tcp_drop whit reason,for epbf trace
> + */
This comment is (a) misspelled, (b) doesn't add much value.
> +static void tcp_drop(struct sock *sk, struct sk_buff *skb,
> + enum tcp_drop_reason reason)
> +{
> + trace_tcp_drop(sk, skb, reason);
> + __tcp_drop(sk, skb);
> +}
Powered by blists - more mailing lists