mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: menglong8.dong@gmail.com
To: michael.chan@broadcom.com, leon@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Menglong Dong <imagedong@tencent.com>,
	Leon Romanovsky <leonro@nvidia.com>
Subject: [PATCH net-next v2] bnxt_en: use dev_consume_skb_any() in bnxt_tx_int
Date: Tue, 11 Jul 2023 19:07:43 +0800	[thread overview]
Message-ID: <20230711110743.39067-1-imagedong@tencent.com> (raw)

From: Menglong Dong <imagedong@tencent.com>

In bnxt_tx_int(), the skb in the tx ring buffer will be freed after the
transmission completes with dev_kfree_skb_any(), which will produce
the noise on the tracepoint "skb:kfree_skb":

$ perf script record -e skb:kfree_skb -a
$ perf script
  swapper     0 [014] 12814.337522: skb:kfree_skb: skbaddr=0xffff88818f145ce0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [003] 12814.338318: skb:kfree_skb: skbaddr=0xffff888108380600 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12814.375258: skb:kfree_skb: skbaddr=0xffff88818f147ce0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12814.451960: skb:kfree_skb: skbaddr=0xffff88818f145ce0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [008] 12814.562166: skb:kfree_skb: skbaddr=0xffff888112664600 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12814.732517: skb:kfree_skb: skbaddr=0xffff88818f145ce0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12814.800608: skb:kfree_skb: skbaddr=0xffff88810025d100 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12814.861501: skb:kfree_skb: skbaddr=0xffff888108295a00 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12815.377038: skb:kfree_skb: skbaddr=0xffff88818f147ce0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
  swapper     0 [014] 12815.395530: skb:kfree_skb: skbaddr=0xffff88818f145ee0 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED

And the call stack is like this:

$ perf script record -e skb:kfree_skb -a --call-graph fp
$ perf script
swapper     0 [015] 12915.386236: skb:kfree_skb: skbaddr=0xffff88b0473cd000 protocol=2048 location=dev_kfree_skb_any_reason+0x2e reason: NOT_SPECIFIED
        ffffffff81e5b0a7 kfree_skb_reason+0x117 (vmlinux)
        ffffffff81e5b0a7 kfree_skb_reason+0x117 (vmlinux)
        ffffffff81e6dd1e dev_kfree_skb_any_reason+0x2e (vmlinux)
        ffffffffa04510d5 bnxt_tx_int+0x95 ([bnxt_en])
        ffffffffa0454ee5 __bnxt_poll_work_done+0x25 ([bnxt_en])
        ffffffffa045b9d2 bnxt_poll+0x72 ([bnxt_en])
        ffffffff81e7b47e __napi_poll+0x2e (vmlinux)
        ffffffff81e7bb34 net_rx_action+0x294 (vmlinux)
        ffffffff8218ff5e __do_softirq+0xfe (vmlinux)
        ffffffff810ad51e irq_exit_rcu+0x7e (vmlinux)
        ffffffff82175bb5 common_interrupt+0xc5 (vmlinux)
        ffffffff82200d27 asm_common_interrupt+0x27 (vmlinux)
        ffffffff8217ae54 intel_idle_irq+0x64 (vmlinux)
        ffffffff81dea7ae cpuidle_enter+0x2e (vmlinux)
        ffffffff811057e3 call_cpuidle+0x23 (vmlinux)
        ffffffff8110b16a do_idle+0x1ea (vmlinux)
        ffffffff8110b3cd cpu_startup_entry+0x1d (vmlinux)
        ffffffff8106dc08 start_secondary+0x118 (vmlinux)
        ffffffff81000263 secondary_startup_64_no_verify+0x17e (vmlinux)

Replace dev_kfree_skb_any() with dev_consume_skb_any() in bnxt_tx_int()
to reduce the noise.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
---
v2:
- be more specific in the commit message
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e5b54e6025be..d84ded8db93d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -685,7 +685,7 @@ static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts)
 next_tx_int:
 		cons = NEXT_TX(cons);
 
-		dev_kfree_skb_any(skb);
+		dev_consume_skb_any(skb);
 	}
 
 	WRITE_ONCE(txr->tx_cons, cons);
-- 
2.40.1


             reply	other threads:[~2023-07-11 11:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 11:07 menglong8.dong [this message]
2023-07-12  3:09 ` Jakub Kicinski
2023-07-12  5:48   ` Leon Romanovsky
2023-07-12  3:30 ` patchwork-bot+netdevbpf

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=20230711110743.39067-1-imagedong@tencent.com \
    --to=menglong8.dong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=imagedong@tencent.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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®