From: sashiko-bot@kernel.org
To: "Srinivas Neeli" <srinivas.neeli@amd.com>
Cc: dmaengine@vger.kernel.org, Frank.Li@kernel.org, vkoul@kernel.org
Subject: Re: [PATCH v4 3/4] net: xilinx: axienet: Derive RX frame length from residue in dmaengine path
Date: Tue, 14 Jul 2026 07:22:43 +0000 [thread overview]
Message-ID: <20260714072243.7CE7F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260713072146.45269-4-srinivas.neeli@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The dmaengine teardown path leaks all in-flight SKBs and DMA mappings when the interface is stopped.
--
--- Patch [3]: [PATCH v4 3/4] net: xilinx: axienet: Derive RX frame length from residue in dmaengine path ---
commit 99e70bd1e2ac117d993d11234fd0dea54d95440b
Author: Srinivas Neeli <srinivas.neeli@amd.com>
Subject: net: xilinx: axienet: Derive RX frame length from residue in dmaengine path
This commit updates the dmaengine RX path to derive the received frame
length from the dmaengine residue rather than descriptor APP metadata.
This removes the dependency on the optional AXI4-Stream status/control
interface.
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index fcf517069d161..67d1b8e91d683 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -53,7 +53,6 @@
[ ... ]
While reviewing this code, I noticed a pre-existing issue in axienet_stop():
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:axienet_stop() {
...
for (i = 0; i < TX_BD_NUM_MAX; i++)
kfree(lp->tx_skb_ring[i]);
kfree(lp->tx_skb_ring);
for (i = 0; i < RX_BUF_NUM_DEFAULT; i++)
kfree(lp->rx_skb_ring[i]);
kfree(lp->rx_skb_ring);
...
}
[Severity: High]
This is a pre-existing issue, but does this dmaengine teardown path leak
all in-flight SKBs and DMA mappings when the interface is stopped?
When using dmaengine, the DMA channels are terminated which aborts
transfers without calling completion callbacks. The code then iterates
through the descriptor arrays and frees each skbuf_dma_descriptor
container.
It appears to fail to unmap the dma_address and free the actual skb stored
within the descriptor.
Could toggling the interface down and up repeatedly leak the entire RX ring
and any pending TX SKBs along with their DMA mappings, potentially
exhausting system memory and IOMMU space over time?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260713072146.45269-1-srinivas.neeli@amd.com?part=3
next prev parent reply other threads:[~2026-07-14 7:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 7:21 [PATCH v4 0/4] dmaengine: xilinx_dma: MCDMA descriptor and metadata handling improvements Srinivas Neeli
2026-07-13 7:21 ` [PATCH v4 1/4] dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction Srinivas Neeli
2026-07-13 7:21 ` [PATCH v4 2/4] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Srinivas Neeli
2026-07-14 7:22 ` sashiko-bot
2026-07-13 7:21 ` [PATCH v4 3/4] net: xilinx: axienet: Derive RX frame length from residue in dmaengine path Srinivas Neeli
2026-07-13 9:44 ` Pandey, Radhey Shyam
2026-07-14 7:22 ` sashiko-bot [this message]
2026-07-13 7:21 ` [PATCH v4 4/4] dmaengine: xilinx_dma: Extend metadata handling for AXI DMA and MCDMA Srinivas Neeli
2026-07-13 9:50 ` Pandey, Radhey Shyam
2026-07-14 7:22 ` 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=20260714072243.7CE7F1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=srinivas.neeli@amd.com \
--cc=vkoul@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.