DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ivan Malov <ivan.malov@arknetworks.am>
Cc: dev@dpdk.org,
	Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
	Roman Zhukov <Roman.Zhukov@arknetworks.am>,
	Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH v3 2/2] net/sfc: provide cached dev info to use in secondary process
Date: Mon, 24 Aug 2026 08:34:03 -0700	[thread overview]
Message-ID: <20260824083403.6561e6cc@phoenix.local> (raw)
In-Reply-To: <20260822000646.12718-3-ivan.malov@arknetworks.am>

On Sat, 22 Aug 2026 04:06:46 +0400
Ivan Malov <ivan.malov@arknetworks.am> wrote:

> Secondary process support in the 'test-pmd' application now requires that
> the driver expose the 'dev_infos_get' method within that context. Use the
> cached dev info from the primary process in order to meet the requirement.
> 
> Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
> Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
> ---

Looks like AI does see one valid race in the use of the cache.
Sorry for the word salad. It is hard to get it be concise.

Review of [PATCH v3 2/2] net/sfc: provide cached dev info to use in
secondary process

Error: the driver sets RTE_PCI_DRV_PROBE_AGAIN, and re-probe of an
existing device (to add representors) runs this code again when the
ethdev already exists, dev_info_cache_is_valid is already true, and
secondary processes are attached and may call dev_infos_get at any
time.  rte_eth_dev_info_get() begins by memset()ing the structure it
is given, which here is the shared cache, so it is zeroed and then
refilled while the flag stays true; a secondary reading during that
window gets zeroed or partially refilled dev info reported as valid.
This is not the initial-fill race raised on v2 -- there the release
store after the fill does order things correctly.

Fix: only fill the cache when the ethdev was just created, since the
values do not change between probes of the same device.  dev_created
is already in scope:

	if (dev_created && rte_eal_process_type() == RTE_PROC_PRIMARY) {

  reply	other threads:[~2026-08-24 15:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 13:03 [PATCH 0/2] net/sfc: fix and extend secondary process support Ivan Malov
2026-08-20 13:03 ` [PATCH 1/2] net/sfc: fix shared adapter pointer set in secondary process Ivan Malov
2026-08-21 19:09   ` Stephen Hemminger
2026-08-20 13:03 ` [PATCH 2/2] net/sfc: provide cached dev info to use " Ivan Malov
2026-08-21 19:10   ` Stephen Hemminger
2026-08-21 23:45 ` [PATCH v2 0/2] net/sfc: fix and extend secondary process support Ivan Malov
2026-08-21 23:45   ` [PATCH v2 1/2] net/sfc: fix shared adapter pointer set in secondary process Ivan Malov
2026-08-21 23:45   ` [PATCH v2 2/2] net/sfc: provide cached dev info to use " Ivan Malov
2026-08-22  0:06 ` [PATCH v3 0/2] net/sfc: fix and extend secondary process support Ivan Malov
2026-08-22  0:06   ` [PATCH v3 1/2] net/sfc: fix shared adapter pointer set in secondary process Ivan Malov
2026-08-22  0:06   ` [PATCH v3 2/2] net/sfc: provide cached dev info to use " Ivan Malov
2026-08-24 15:34     ` Stephen Hemminger [this message]
2026-08-24 16:30 ` [PATCH v4 0/2] net/sfc: fix and extend secondary process support Ivan Malov
2026-08-24 16:30   ` [PATCH v4 1/2] net/sfc: fix shared adapter pointer set in secondary process Ivan Malov
2026-08-24 16:30   ` [PATCH v4 2/2] net/sfc: provide cached dev info to use " Ivan Malov
2026-08-24 17:02   ` [PATCH v4 0/2] net/sfc: fix and extend secondary process support 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=20260824083403.6561e6cc@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=Roman.Zhukov@arknetworks.am \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@arknetworks.am \
    --cc=pieter.jansen-van-vuuren@amd.com \
    --cc=viacheslav.galaktionov@arknetworks.am \
    /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