From: Kordian Chmielewski <kudzo51@gmail.com>
To: netdev@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Rafał Miłecki" <rafal@milecki.pl>,
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>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 3/7] net: bcm4908_enet: release the TX ring on stop
Date: Sun, 15 Nov 2026 14:49:23 +0100 [thread overview]
Message-ID: <20261115134923.55351-1-kudzo51@gmail.com> (raw)
In-Reply-To: <20261113235847.517308-4-kudzo51@gmail.com>
Sashiko's review of this patch [1] attributes one Medium point to it:
when the TX channel does not stop in time, the skbs left in the ring
leak, and on unbind bcm4908_enet_dma_free() frees the slots and the
descriptor ring while the channel may still be running. It suggests
forcing the channel idle with ENET_DMA_CTRL_CHANNEL_RESET or by clearing
MASTER_EN, and then cleaning the ring.
The leak after a timeout is on purpose, and the changelog says so. The
review of v2 suggested either forcing a reset or leaking the buffers.
I don't know what a channel reset does to a transfer in flight, so I
chose the leak: it costs memory, but the DMA never reads a freed skb.
The timeout never fired in my tests; every stop, all made while the
router was sending at line rate, finished in time. The unbind path is
older than this patch: before it, stop() did not wait for the TX
channel at all, and bcm4908_enet_dma_free() kfree()d the slot array
with the skbs still in it.
The review also points out that RX has the same problem the other way
round: bcm4908_enet_dma_rx_ring_disable() only warns on a timeout, and
stop() frees the RX buffers anyway, while the DMA may still write into
them. That one is older too, and I'll add it to the follow-ups, next to
the ignored dma_init() error in open().
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113235847.517308-1-kudzo51%40gmail.com
next prev parent reply other threads:[~2026-11-15 13:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 23:58 [PATCH net v3 0/7] net: bcm4908_enet: TX ring and DMA fixes Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 1/7] net: bcm4908_enet: fix the TX ring wrap Kordian Chmielewski
2026-11-14 23:59 ` netdev-bot+sashiko
2026-11-15 13:49 ` Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 2/7] net: bcm4908_enet: drop a TX frame whose DMA mapping failed Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 3/7] net: bcm4908_enet: release the TX ring on stop Kordian Chmielewski
2026-11-14 23:59 ` netdev-bot+sashiko
2026-11-15 13:49 ` Kordian Chmielewski [this message]
2026-11-13 23:58 ` [PATCH net v3 4/7] net: bcm4908_enet: unmap the buffer of a dropped RX frame Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 5/7] net: bcm4908_enet: unmap RX buffers on stop with their mapped size Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 6/7] net: bcm4908_enet: publish the buffer address before OWN Kordian Chmielewski
2026-11-13 23:58 ` [PATCH net v3 7/7] net: bcm4908_enet: order the TX ring index accesses Kordian Chmielewski
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=20261115134923.55351-1-kudzo51@gmail.com \
--to=kudzo51@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafal@milecki.pl \
/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