From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Nicolai Buchwitz <nb@tipi-net.de>,
Doug Berger <opendmb@gmail.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: bcmgenet: unshare the skb before writing the control block
Date: Tue, 13 Oct 2026 15:51:01 -0700 [thread overview]
Message-ID: <e0f1afe8-2470-4f76-b612-fa141a2d21e5@broadcom.com> (raw)
In-Reply-To: <20261009-nb-genet-shared-skb-net-v1-1-c6d0a841977d@tipi-net.de>
On 10/9/26 03:10, Nicolai Buchwitz wrote:
> bcmgenet stores first_cb, last_cb and bytes_sent in the skb control
> block and reads them back on completion to free the skb and credit BQL.
> ether_setup() leaves IFF_TX_SKB_SHARING set, so the stack can resubmit
> a shared skb that is still in the ring. The next transmit overwrites
> last_cb, so the earlier slots complete without crediting their bytes
> and BQL stalls the queue until the watchdog resets it.
>
> Unshare the skb before writing the control block.
>
> Reproduce with pktgen in clone_skb mode, which hands the driver the same
> skb while earlier copies are still in the ring:
>
> modprobe pktgen
> pg=/proc/net/pktgen
> echo "add_device eth0" > $pg/kpktgend_0
> echo "dst_mac AA:BB:CC:DD:EE:FF" > $pg/eth0
> echo "dst 192.0.2.1" > $pg/eth0
> echo "clone_skb 8" > $pg/eth0
> echo "count 0" > $pg/eth0
> echo start > $pg/pgctrl &
> sleep 5
> echo stop > $pg/pgctrl
> wait
> cat /sys/class/net/eth0/queues/tx-0/byte_queue_limits/inflight
>
> inflight stays nonzero on the now idle queue. clone_skb 0 leaves it at
> zero.
>
> Fixes: f48bed16a756 ("net: bcmgenet: Free skb after last Tx frag")
> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
prev parent reply other threads:[~2026-10-13 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 10:10 Nicolai Buchwitz
2026-10-09 10:14 ` netdev-bot+sinfo
2026-10-09 10:21 ` Nicolai Buchwitz
2026-10-10 11:10 ` netdev-bot+sashiko
2026-10-10 11:40 ` Nicolai Buchwitz
2026-10-13 22:51 ` Florian Fainelli [this message]
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=e0f1afe8-2470-4f76-b612-fa141a2d21e5@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--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®