mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: David Ahern <dsahern@gmail.com>
Cc: linux-kernel@vger.kernel.org, rostedt@goodmis.org,
	mingo@redhat.com, davem@davemloft.net, kuba@kernel.org,
	edumazet@google.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	imagedong@tencent.com, joao.m.martins@oracle.com,
	joe.jin@oracle.com, netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH RFC 1/4] net: skb: use line number to trace dropped skb
Date: Thu, 3 Feb 2022 09:13:52 -0800	[thread overview]
Message-ID: <79e4d4d4-b87a-e8ad-af24-b95a02d5ec76@oracle.com> (raw)
In-Reply-To: <e34e03db-9764-4728-9f6a-df85659c5089@gmail.com>


Hi David,

On 2/3/22 7:48 AM, David Ahern wrote:
> On 2/3/22 8:37 AM, Dongli Zhang wrote:
>> Sometimes the kernel may not directly call kfree_skb() to drop the sk_buff.
>> Instead, it "goto drop" and call kfree_skb() at 'drop'. This make it
>> difficult to track the reason that the sk_buff is dropped.
>>
>> The commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()") has
>> introduced the kfree_skb_reason() to help track the reason. However, we may
>> need to define many reasons for each driver/subsystem.
>>
>> To avoid introducing so many new reasons, this is to use line number
>> ("__LINE__") to trace where the sk_buff is dropped. As a result, the reason
>> will be generated automatically.
>>
> 
> I don't agree with this approach. It is only marginally better than the
> old kfree_skb that only gave the instruction pointer. That tells you the
> function that dropped the packet, but not why the packet is dropped.
> Adding the line number only makes users have to consult the source code.
> 
> When I watch drop monitor for kfree_skb I want to know *why* the packet
> was dropped, not the line number in the source code. e.g., dropmon
> showing OTHERHOST means too many packets are sent to this host (e.g.,
> hypervisor) that do not belong to the host or the VMs running on it, or
> packets have invalid checksum (IP, TCP, UDP). Usable information by
> everyone, not just someone with access to the source code for that
> specific kernel.
> 
Thank you very much for the suggestion!

I will not follow this approach. I will introduce new reasons to TUN and TAP
drivers.

Dongli Zhang

  reply	other threads:[~2022-02-03 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 15:37 [PATCH RFC 0/4] net: skb: to use (function, line) pair as reason for kfree_skb_reason() Dongli Zhang
2022-02-03 15:37 ` [PATCH RFC 1/4] net: skb: use line number to trace dropped skb Dongli Zhang
2022-02-03 15:48   ` David Ahern
2022-02-03 17:13     ` Dongli Zhang [this message]
2022-02-03 15:59   ` Eric Dumazet
2022-02-03 17:14     ` Dongli Zhang
2022-02-03 15:37 ` [PATCH RFC 2/4] net: skb: add function name as part of reason Dongli Zhang
2022-02-03 15:37 ` [PATCH RFC 3/4] net: tun: track dropped skb via kfree_skb_reason() Dongli Zhang
2022-02-03 15:37 ` [PATCH RFC 4/4] net: tap: " Dongli Zhang

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=79e4d4d4-b87a-e8ad-af24-b95a02d5ec76@oracle.com \
    --to=dongli.zhang@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=imagedong@tencent.com \
    --cc=joao.m.martins@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --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 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®