DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH] net/ring: remove internal devarg
Date: Tue, 22 Sep 2026 15:09:59 +0100	[thread overview]
Message-ID: <arKMN5dwo0PD6teP@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260922063401.6f2faa98@phoenix.local>

On Tue, Sep 22, 2026 at 06:34:01AM -0700, Stephen Hemminger wrote:
> 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.
> 

That's an unrealistic scenario, is it not? Having an ethdev creation
callback which creates another ethdev just leads to an infinite chain of
callbacks.

> 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).
> 

Since there is no "internal" parameter any more, I don't see this as being
necessary.

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

Something that can be fixed on apply, I think, if it's a concern.

/Bruce

  reply	other threads:[~2026-09-22 14:10 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
2026-09-22 14:09   ` Bruce Richardson [this message]
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=arKMN5dwo0PD6teP@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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