mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Rosen Penev <rosenp@gmail.com>, netdev@vger.kernel.org
Cc: "Rafał Miłecki" <rafal@milecki.pl>,
	"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>,
	"Felix Fietkau" <nbd@openwrt.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: bgmac: rate limit RX error messages
Date: Thu, 22 Oct 2026 15:06:45 -0700	[thread overview]
Message-ID: <8b061dc1-73a9-4823-abb9-535eb4677b13@broadcom.com> (raw)
In-Reply-To: <20261018231629.39734-1-rosenp@gmail.com>

On 10/18/26 16:16, Rosen Penev wrote:
> When the RX ring is full the RX FIFO overflows. With RX overflow
> continue enabled, the DMA engine then writes one frame with a bogus
> length (always 0x45c2 on a BCM4716), which the driver drops with
> "Found oversized packet at slot %d, DMA issue!".
> 
> Under sustained overload this happens on every NAPI poll. On an Asus
> RT-N16 a 950 Mbit/s UDP stream to the router printed about 1450 such
> lines in 20 seconds. The messages are printed from NAPI context, so
> with a serial console the router spends most of its time printing.
> 
> The frames are already accounted in rx_length_errors and rx_errors.
> Rate limit both RX error messages. With this change the same flood
> printed 60 lines while rx_length_errors counted 14297 dropped frames.
> 
> Fixes: 6a6c708469c9 ("bgmac: add check for oversized packets")
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>   drivers/net/ethernet/broadcom/bgmac.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index 1835266fdd09..b3a92ae95de3 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -447,16 +447,18 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
>   
>   			/* Check for poison and drop or pass the packet */
>   			if (len == 0xdead && flags == 0xbeef) {
> -				netdev_err(bgmac->net_dev, "Found poisoned packet at slot %d, DMA issue!\n",
> -					   ring->start);
> +				if (net_ratelimit())
> +					netdev_err(bgmac->net_dev, "Found poisoned packet at slot %d, DMA issue!\n",
> +						   ring->start);
>   				put_page(virt_to_head_page(buf));
>   				bgmac->net_dev->stats.rx_errors++;
>   				break;
>   			}
>   
>   			if (len > BGMAC_RX_ALLOC_SIZE) {
> -				netdev_err(bgmac->net_dev, "Found oversized packet at slot %d, DMA issue!\n",
> -					   ring->start);
> +				if (net_ratelimit())
> +					netdev_err(bgmac->net_dev, "Found oversized packet at slot %d, DMA issue!\n",
> +						   ring->start);

No objection, but the issue is that we are going over 
BGMAC_RX_ALLOC_SIZE, and I believe the check should actually be 
BGMAC_RX_MAX_FRAME_SIZE because we have the skb_shared_info at the end 
of the packet, if we start overflowing that, we will call 
skb_over_panic() very soon.
-- 
Florian

      parent reply	other threads:[~2026-10-22 22:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 23:16 Rosen Penev
2026-10-21 10:47 ` Daniel Machon
2026-10-22  0:40 ` patchwork-bot+netdevbpf
2026-10-22 22:06 ` 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=8b061dc1-73a9-4823-abb9-535eb4677b13@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=nbd@openwrt.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafal@milecki.pl \
    --cc=rosenp@gmail.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®