The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net,
	kuba@kernel.org, rostedt@goodmis.org, mingo@redhat.com,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	imagedong@tencent.com, joao.m.martins@oracle.com,
	joe.jin@oracle.com, dsahern@gmail.com, edumazet@google.com
Subject: [PATCH 0/2] tun/tap: use kfree_skb_reason() to trace dropped skb
Date: Mon,  7 Feb 2022 19:55:08 -0800	[thread overview]
Message-ID: <20220208035510.1200-1-dongli.zhang@oracle.com> (raw)

The commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()") has
introduced the kfree_skb_reason() to help track the reason. This is to
use kfree_skb_reason() to trace the dropped skb for those two drivers. The
tun and tap are commonly used as virtio-net/vhost-net backend.

This is the 'stacktrace' example for tap when the skb is dropped because
the ptr ring between tap and vhost-net is full.

    kworker/13:0-9759    [013] ..s1.  1439.053393: kfree_skb: skbaddr=000000004109db76 protocol=2054 location=00000000db8dd81c reason: PTR_FULL
    kworker/13:0-9759    [013] ..s2.  1439.053431: <stack trace>
 => trace_event_raw_event_kfree_skb
 => kfree_skb_reason.part.0
 => tap_handle_frame
 => __netif_receive_skb_core
 => __netif_receive_skb_one_core
 => process_backlog
 => __napi_poll
 => net_rx_action
 => __do_softirq
 => do_softirq.part.0
 => netif_rx_ni
 => macvlan_broadcast
 => macvlan_process_broadcast
 => process_one_work
 => worker_thread
 => kthread
 => ret_from_fork

 
This is the 'stacktrace' example for tun when the skb is dropped because
the ptr ring between run and vhost-net is full.

           <idle>-0       [000] b.s2.   499.675592: kfree_skb: skbaddr=00000000ff79867d protocol=2054 location=00000000635128db reason: PTR_FULL
          <idle>-0       [000] b.s3.   499.675612: <stack trace>
 => trace_event_raw_event_kfree_skb
 => kfree_skb_reason.part.0
 => tun_net_xmit
 => dev_hard_start_xmit
 => sch_direct_xmit
 => __dev_queue_xmit
 => br_dev_queue_push_xmit
 => br_handle_frame_finish
 => br_handle_frame
 => __netif_receive_skb_core
 => __netif_receive_skb_list_core
 => netif_receive_skb_list_internal
 => napi_complete_done
 => ixgbe_poll
 => __napi_poll
 => net_rx_action
 => __do_softirq
 => __irq_exit_rcu
 => common_interrupt
 => asm_common_interrupt
 => cpuidle_enter_state
 => cpuidle_enter
 => do_idle
 => cpu_startup_entry
 => start_kernel
 => secondary_startup_64_no_verify



 drivers/net/tap.c          | 30 ++++++++++++++++++++++--------
 drivers/net/tun.c          | 33 +++++++++++++++++++++++++--------
 include/linux/skbuff.h     | 11 +++++++++++
 include/trace/events/skb.h | 11 +++++++++++
 4 files changed, 69 insertions(+), 16 deletions(-)


Thank you very much!

Dongli Zhang



             reply	other threads:[~2022-02-08  3:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  3:55 Dongli Zhang [this message]
2022-02-08  3:55 ` [PATCH 1/2] net: tap: track dropped skb via kfree_skb_reason() Dongli Zhang
2022-02-08  4:32   ` Eric Dumazet
2022-02-08 16:42     ` Dongli Zhang
2022-02-08  4:47   ` David Ahern
2022-02-08 17:20     ` Dongli Zhang
2022-02-08  3:55 ` [PATCH 2/2] net: tun: " Dongli Zhang
2022-02-08  5:03   ` David Ahern
2022-02-08 18:08     ` 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=20220208035510.1200-1-dongli.zhang@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=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 \
    /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