All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] net/ring: remove internal devarg
Date: Tue, 22 Sep 2026 06:34:01 -0700	[thread overview]
Message-ID: <20260922063401.6f2faa98@phoenix.local> (raw)
In-Reply-To: <20260922113614.2952557-1-bruce.richardson@intel.com>

On Tue, 22 Sep 2026 12:36:14 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> The devarg "internal" was used to pass a pointer to the creation
> function to reuse set parameters. However, this meant it could also be
> used as a devarg on the commandline leading to incorrect behaviour.
> Redesign the passing of the args parameters to use a per-thread global
> instead. The wrapper function sets the global to a valid value before
> calling the main creation function, skipping passing a devarg, before
> resetting the pointer back to NULL when the function returns.
> 
> Bugzilla ID: 1687
> Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Minor nits from Opus review:

Review: [PATCH] net/ring: remove internal devarg
Patchwork: 169914

Applies cleanly to main, builds with -Dwerror=true. Fixes tag hash
96cb19521147 verified. Removing a user-reachable devarg that is
dereferenced as a raw pointer is the right fix.

Warning

The per-lcore pointer is still set while user callbacks run.
do_eth_dev_ring_create() calls rte_eth_dev_probing_finish(), which
fires RTE_ETH_EVENT_NEW callbacks synchronously on the same thread.
If a callback calls rte_vdev_init("net_ring_foo", "nodeaction=...")
the nested probe sees eth_ring_internal_args != NULL, ignores the
user's devargs, and attaches net_ring_foo to the outer caller's
rings.

Clear the pointer in probe right after reading it:

	internal_args = RTE_PER_LCORE(eth_ring_internal_args);
	RTE_PER_LCORE(eth_ring_internal_args) = NULL;
	if (internal_args != NULL) {

Keep the reset after rte_vdev_init() in rte_eth_from_rings() to
cover the paths where probe is never reached (-EEXIST, no driver
match). This also makes the comment "consumed and cleared by probe"
true; as written, probe does not clear it.

Alternatively add the vdev name to struct ring_internal_args and
require a match in probe. Either works; clearing is simpler.

Info

No test coverage. app/test/test_pmd_ring.c could add a case that
"net_ring_x,internal=0x1" no longer dereferences the value (it now
falls into the "Ignoring unsupported parameters" path).

Double space before "*/" in the comment above
RTE_DEFINE_PER_LCORE.

  reply	other threads:[~2026-09-22 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 11:36 [PATCH] net/ring: remove internal devarg Bruce Richardson
2026-09-22 13:34 ` Stephen Hemminger [this message]
2026-09-22 14:09   ` Bruce Richardson
2026-09-22 14:25     ` Bruce Richardson
2026-09-22 14:24 ` [PATCH v2] " Bruce Richardson
2026-09-22 15:32   ` Stephen Hemminger

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=20260922063401.6f2faa98@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --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 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.