All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Zhongya Yan <yan2228598786@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	edumazet@google.com, rostedt@goodmis.org, mingo@redhat.com,
	davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	hengqi.chen@gmail.com, yhs@fb.com
Subject: Re: [PATCH] net: tcp_drop adds `reason` parameter for tracing
Date: Tue, 24 Aug 2021 07:20:49 -0700	[thread overview]
Message-ID: <20210824072049.76789bba@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20210824125140.190253-1-yan2228598786@gmail.com>

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);
> +}

  reply	other threads:[~2021-08-24 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 12:51 [PATCH] net: tcp_drop adds `reason` parameter for tracing Zhongya Yan
2021-08-24 14:20 ` Jakub Kicinski [this message]
2021-08-24 15:22 ` Eric Dumazet
2021-08-24 15:29 ` Steven Rostedt
     [not found]   ` <CALcyL7icKx5RH9UXiEqLmZtP5MViip5Pn1yNyogbADA3Xeo3xw@mail.gmail.com>
2021-08-25 15:39     ` Eric Dumazet
2021-08-25 21:47       ` Steven Rostedt

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=20210824072049.76789bba@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=hengqi.chen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=yan2228598786@gmail.com \
    --cc=yhs@fb.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.