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

Stephen Hemminger stephen at networkplumber.org
Mon Aug 24 17:34:03 CEST 2026


On Sat, 22 Aug 2026 04:06:46 +0400
Ivan Malov <ivan.malov at 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 at arknetworks.am>
> Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov at 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) {


More information about the dev mailing list