BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yangyu Chen" <cyy@cyyself.name>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: atlantic: free stranded TX buffers on ring deinit
Date: Fri, 10 Jul 2026 17:38:14 +0000	[thread overview]
Message-ID: <20260710173815.2E0741F000E9@smtp.kernel.org> (raw)
In-Reply-To: <tencent_8FE30FDFA32089B69BA3112E4A4C5E886D06@qq.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The patch fixes a resource leak of stranded TX buffers on interface teardown by replacing `aq_ring_tx_clean()` with the restored `aq_ring_tx_deinit()` in `aq_vec_deinit()`, but misses the identical leak pattern in `aq_ptp_ring_deinit()`.
--

--- Patch [1]: [PATCH net-next 1/2] net: atlantic: free stranded TX buffers on ring deinit ---
commit 0bceee292a00058408f6f3baf2ae8103a4e90f9c
Author: Yangyu Chen <cyy@cyyself.name>

net: atlantic: free stranded TX buffers on ring deinit

This commit brings back aq_ring_tx_deinit() to properly drain TX rings
during teardown. This prevents silent memory leaks of stranded buffers and
stalls during page pool destruction when the interface goes down under
TX or XDP_TX load.

> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
> index 2f9033ceed8ce..05814fea0f5f7 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
[ ... ]
> @@ -275,7 +275,7 @@ void aq_vec_deinit(struct aq_vec_s *self)
>  
>  	for (i = 0U; self->tx_rings > i; ++i) {
>  		ring = self->ring[i];
> -		aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]);
> +		aq_ring_tx_deinit(&ring[AQ_VEC_TX_ID]);

[Severity: High]
This is a pre-existing issue, but should aq_ptp_ring_deinit() also be
updated to use aq_ring_tx_deinit() instead of aq_ring_tx_clean()?

In drivers/net/ethernet/aquantia/atlantic/aq_ptp.c:aq_ptp_ring_deinit():

	aq_ring_tx_clean(&aq_ptp->ptp_tx);
	aq_ring_rx_deinit(&aq_ptp->ptp_rx);

Since aq_ring_tx_clean() stops at hw_head and applies a budget, any
in-flight SKBs and their DMA mappings on the PTP TX ring might still be
permanently leaked when the hardware is stopped and the interface is
brought down.

Does the PTP ring teardown need the same fix applied here?

>  		aq_ring_rx_deinit(&ring[AQ_VEC_RX_ID]);
>  	}
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_7DB01BE7F8FA056BB5F11D3570CF636C4309@qq.com?part=1

  reply	other threads:[~2026-07-10 17:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 17:36 [PATCH net-next 0/2] net: atlantic: convert RX path to page_pool Yangyu Chen
2026-07-09 17:37 ` [PATCH net-next 1/2] net: atlantic: free stranded TX buffers on ring deinit Yangyu Chen
2026-07-10 17:38   ` sashiko-bot [this message]
2026-07-09 17:37 ` [PATCH net-next 2/2] net: atlantic: convert RX path to page_pool Yangyu Chen
2026-07-10 17:38   ` sashiko-bot

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=20260710173815.2E0741F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cyy@cyyself.name \
    --cc=sashiko-reviews@lists.linux.dev \
    /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