From: Stephen Hemminger <stephen@networkplumber.org>
To: Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>
Cc: <dev@dpdk.org>, <jgrajcia@cisco.com>, <ferruh.yigit@amd.com>,
<stable@dpdk.org>, <mattias.ronnblom@ericsson.com>,
<heng.wang@ericsson.com>, <ravi.kumar.chennaparapu@ericsson.com>
Subject: Re: [PATCH] net/memif: fix descriptor flags corruption in multi-segment TX
Date: Mon, 16 Mar 2026 09:08:45 -0700 [thread overview]
Message-ID: <20260316090845.158843db@phoenix.local> (raw)
In-Reply-To: <20260303110152.276344-1-sriram.yagnaraman@ericsson.com>
On Tue, 3 Mar 2026 12:01:52 +0100
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> wrote:
> The memif TX path was using |= to set descriptor flags, which could
> leave stale flag bits from previous ring iterations. This caused
> descriptor corruption when the ring wrapped around, leading to
> malformed packet chains and RX failures.
>
> Initialize d0->flags to 0 before setting MEMIF_DESC_FLAG_NEXT to
> ensure clean descriptor state on each transmission.
>
> Fixes: 43b815d88188 ("net/memif: support zero-copy slave")
> Cc: stable@dpdk.org
>
> Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>
Looks good, the AI review spotted one thing.
Error: Asymmetric mbuf cleanup between the two Rx paths on truncation
In the first Rx path (fast path, around line 376), the truncation
handler frees mbuf_head and also frees the remaining pre-allocated
mbufs with rte_pktmbuf_free_bulk(mbufs + rx_pkts, MAX_PKT_BURST -
rx_pkts).
In the second Rx path (slow path, around line 469), the
truncation handler frees mbuf_head but does NOT free the remaining
pre-allocated mbufs. If the slow path also pre-allocates mbufs into the
mbufs[] array, this is a resource leak. If the slow path does not
pre-allocate (i.e., allocates one mbuf at a time), then the asymmetry
is correct but should be verified against the full source. Without
seeing the full function, I cannot be 100% certain which case applies.
The existing mbuf == NULL failure path in the fast path (visible in the
context at line 163) also does the rte_pktmbuf_free_bulk cleanup, which
suggests the slow path may handle mbufs differently. Worth confirming
that the slow path does not leak pre-allocated mbufs on this new error
path.
next prev parent reply other threads:[~2026-03-16 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 11:01 [PATCH] net/memif: fix descriptor flags corruption in multi-segment TX Sriram Yagnaraman
2026-03-03 16:13 ` Stephen Hemminger
2026-03-16 16:08 ` Stephen Hemminger [this message]
2026-03-16 20:08 ` Sriram Yagnaraman
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=20260316090845.158843db@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=heng.wang@ericsson.com \
--cc=jgrajcia@cisco.com \
--cc=mattias.ronnblom@ericsson.com \
--cc=ravi.kumar.chennaparapu@ericsson.com \
--cc=sriram.yagnaraman@ericsson.com \
--cc=stable@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox