DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	dev@dpdk.org, "Thomas Monjalon" <thomas@monjalon.net>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	"Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	"Ivan Malov" <ivan.malov@arknetworks.am>
Subject: Re: [PATCH v3] mbuf: de-inline sanity checking a reinitialized mbuf
Date: Sat, 26 Jul 2025 15:01:17 +0300	[thread overview]
Message-ID: <528ee607-8212-429d-a6c4-02e0e6408b99@oktetlabs.ru> (raw)
In-Reply-To: <20250722093431.555214-1-mb@smartsharesystems.com>

On 7/22/25 12:34, Morten Brørup wrote:
> Sanity checking a reinitialized mbuf (a.k.a. raw mbuf) has been refactored
> to follow the same design pattern as sanity checking a normal mbuf, and
> now depends on RTE_LIBRTE_MBUF_DEBUG instead of RTE_ENABLE_ASSERT.
> 
> The details of the changes are as follows:
> 
> Non-inlined functions rte_mbuf_raw_sanity_check() and rte_mbuf_raw_check()
> have been added.
> They do for a reinitialized mbuf what rte_mbuf_sanity_check() and
> rte_mbuf_check() do for a normal mbuf.
> They basically check the same conditions as __rte_mbuf_raw_sanity_check()
> previously did, but use "if (!condition) rte_panic(message)" instead of
> RTE_ASSERT(), so they don't depend on RTE_ENABLE_ASSERT.
> 
> The inline function __rte_mbuf_raw_sanity_check() has been replaced
> by the new macro __rte_mbuf_raw_sanity_check_mp(), which either calls
> rte_mbuf_raw_sanity_check() or does nothing, depending on
> RTE_LIBRTE_MBUF_DEBUG, just like the __rte_mbuf_sanity_check() macro does
> for a normal mbuf.
> 
> Note that the new macro __rte_mbuf_raw_sanity_check_mp() takes an optional
> mempool parameter to verify that the mbuf belongs to the expected mbuf
> pool.
> This addition is mainly relevant for sanity checking reinitialized mbufs
> freed directly into a given mempool by a PMD when using
> RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE.
> 
> The macro __rte_mbuf_raw_sanity_check() has been kept for backwards API
> compatibility.
> It simply calls __rte_mbuf_raw_sanity_check_mp() without specifying a
> mempool.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>

Really good that the inline is removed.
As far as I remember easier it was an intent to remove rte_panic() from
libraries, but I think it is acceptable in this case.

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

      reply	other threads:[~2025-07-26 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19 10:23 [PATCH] " Morten Brørup
2025-07-19 14:14 ` Morten Brørup
2025-07-19 22:30   ` Ivan Malov
2025-07-20  9:25     ` Morten Brørup
2025-07-20 13:09       ` Ivan Malov
2025-07-21 15:00   ` Stephen Hemminger
2025-07-20 20:49 ` [PATCH v2] " Morten Brørup
2025-07-22  9:34 ` [PATCH v3] " Morten Brørup
2025-07-26 12:01   ` Andrew Rybchenko [this message]

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=528ee607-8212-429d-a6c4-02e0e6408b99@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@arknetworks.am \
    --cc=konstantin.ananyev@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).