mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danesh Petigara <danesh.petigara@broadcom.com>
To: justin.chen@broadcom.com, florian.fainelli@broadcom.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com
Cc: horms@kernel.org, bcm-kernel-feedback-list@broadcom.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Danesh Petigara <danesh.petigara@broadcom.com>
Subject: [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs
Date: Mon, 31 Aug 2026 11:42:33 -0700	[thread overview]
Message-ID: <20260831184235.4133351-1-danesh.petigara@broadcom.com> (raw)

Two fixes for TX descriptor ring handling in the bcmasp driver:

  - tx_spb_ring_full() re-initialized next_index from
    intf->tx_spb_index on every loop iteration instead of advancing
    it, so it only ever checked a single descriptor slot regardless
    of cnt. This let bcmasp_xmit() proceed even when the ring didn't
    actually have enough free slots for the SKB's fragments.

  - bcmasp_xmit() only set txcb->last for the final fragment of an
    SKB, leaving stale true values in reused descriptor slots from a
    prior transmission. Combined with the ring-full miscount above,
    this could cause bcmasp_tx_reclaim() to treat a mid-SKB
    descriptor as the last one and free the sk_buff while later
    fragments were still in flight.

Patch 1 clears txcb->last unconditionally before it is set, and
patch 2 fixes the ring-full slot check to advance through each
candidate slot.

Justin Chen (2):
  net: bcmasp: clear txcb->last before writing each descriptor
  net: bcmasp: fix tx_spb_ring_full() checking same slot cnt times

 drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.54.0


             reply	other threads:[~2026-08-31 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 18:42 Danesh Petigara [this message]
2026-08-31 18:42 ` [PATCH net 1/2] net: bcmasp: clear txcb->last before writing each descriptor Danesh Petigara
2026-09-03 22:39   ` Florian Fainelli
2026-08-31 18:42 ` [PATCH net 2/2] net: bcmasp: fix tx_spb_ring_full() checking same slot cnt times Danesh Petigara
2026-09-03 22:39   ` Florian Fainelli
2026-09-04  0:00 ` [PATCH net 0/2] net: bcmasp: fix TX ring accounting bugs 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=20260831184235.4133351-1-danesh.petigara@broadcom.com \
    --to=danesh.petigara@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=horms@kernel.org \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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®