From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Kordian Chmielewski <kudzo51@gmail.com>, netdev@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.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 1/2] net: bcm4908_enet: keep the RX buffer when the refill fails
Date: Wed, 2 Dec 2026 20:36:53 -0800 [thread overview]
Message-ID: <753af079-32ba-492d-ba9e-c39113557b06@broadcom.com> (raw)
In-Reply-To: <20261202095611.156840-2-kudzo51@gmail.com>
On 12/2/2026 1:56 AM, Kordian Chmielewski wrote:
> poll_rx() refills a descriptor before it passes the old buffer up the
> stack, but bcm4908_enet_dma_alloc_rx_buf() writes the results of the
> allocation and of the mapping into the ring slot before it checks them.
> When either fails, the slot is left with buf == NULL, the old buffer is
> lost while still mapped, and read_idx stays on a descriptor the DMA has
> already completed. A later poll takes that descriptor again and, once
> its refill works, hands the NULL buffer to build_skb(), or to
> skb_free_frag() on the bad-frame path.
>
> Allocate and map into local variables and update the slot only once
> both have worked. When either fails, drop the frame and give its buffer
> back to the DMA, so that the ring keeps going.
>
> Sashiko's reviews of the TX ring series pointed this out. I have not
> seen a refill fail on its own on the hardware.
>
> Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
> Signed-off-by: Kordian Chmielewski <kudzo51@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
next prev parent reply other threads:[~2026-12-03 4:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:56 [PATCH net 0/2] net: bcm4908_enet: RX buffer fixes Kordian Chmielewski
2026-12-02 9:56 ` [PATCH net 1/2] net: bcm4908_enet: keep the RX buffer when the refill fails Kordian Chmielewski
2026-12-03 4:36 ` Florian Fainelli [this message]
2026-12-02 9:56 ` [PATCH net 2/2] net: bcm4908_enet: keep the RX buffers when the RX channel does not stop Kordian Chmielewski
2026-12-03 4:38 ` Florian Fainelli
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=753af079-32ba-492d-ba9e-c39113557b06@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=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=kudzo51@gmail.com \
--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