DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Thomas Monjalon" <thomas@monjalon.net>
Cc: <dev@dpdk.org>, "Shani Peretz" <shperetz@nvidia.com>, <stable@dpdk.org>
Subject: RE: [PATCH] mbuf: fix mbuf operations history recording
Date: Mon, 20 Apr 2026 13:24:17 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65802@smartserver.smartshare.dk> (raw)
In-Reply-To: <23075230.EfDdHjke4D@thomas>

> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, 20 April 2026 12.06
> 
> 20/04/2026 00:12, Morten Brørup:
> > This addresses two bugs in mbuf operations history recording.
> >
> > 1. With mbuf operations history recording enabled, when allocating
> mbufs
> > from a mempool failed, the array of fetched mbuf pointers was not
> set, but
> > it was dereferenced for mbuf operations history recording anyway,
> which
> > would trigger a segmentation fault or cause undefined behavior.
> >
> > This was fixed by changing how the return value from the mempool
> > allocation is checked, so the function returns early on failure, and
> only
> > proceeds on success.
> >
> > 2. When allocating a bulk of mbufs using rte_pktmbuf_alloc_bulk(),
> two
> > mbuf library allocation operations were recorded on the mbuf, because
> the
> > function calls rte_mbuf_raw_alloc_bulk() for allocation, and both
> > functions record a mbuf library allocation operation.
> >
> > This was fixed by not recording a mbuf library allocation operation
> in
> > rte_pktmbuf_alloc_bulk().
> >
> > Fixes: d265a24a32a4 ("mbuf: record mbuf operations history")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> [...]
> 
> It would be better to make an explicit comparison != 0 below:
> 
> > +	if (unlikely(rc))
> > +		return rc;

I would normally have done that, but decided to do it like rte_pktmbuf_alloc_bulk().
If it was a pointer, I would probably have compared != NULL regardless of conventions in the file.

> 
> Thank you for the fixes.
> 
> Acked-by: Thomas Monjalon <thomas@monjalon.net>

Thanks for the fast review response.


  reply	other threads:[~2026-04-20 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-19 22:12 [PATCH] mbuf: fix mbuf operations history recording Morten Brørup
2026-04-20 10:06 ` Thomas Monjalon
2026-04-20 11:24   ` Morten Brørup [this message]
2026-04-22 12:29 ` Morten Brørup
2026-04-29 16:35 ` Konstantin Ananyev
2026-05-11 13:39 ` [PATCH v2] " Morten Brørup

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=98CBD80474FA8B44BF855DF32C47DC35F65802@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=shperetz@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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