RE: [PATCH v2 01/10] net/i40e: permit secondary process Rx path selection

Loftus, Ciara
2026-02-17T11:38:43Z

> On Thu, Feb 05, 2026 at 12:46:18PM +0000, Ciara Loftus wrote:
> > Commit 258f346f5d5e ("net/i40e: use same Rx path across processes")
> > changed the way that secondary processes selected their Rx burst
> > function. Instead of letting secondary processes select their own
> > function, they now used the function selected by the primary process.
> > However, the primary process only selects the function at device start,
> > so if the primary process hadn't started the device by the time the
> > secondary process was selecting its Rx burst function, the secondary
> > process would not select the correct function.
> >
> > This commit addresses this issue by allowing the secondary process to
> > select the path if the device has not been started yet.
> >
> > Fixes: 258f346f5d5e ("net/i40e: use same Rx path across processes")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> > ---
> > drivers/net/intel/i40e/i40e_rxtx.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/intel/i40e/i40e_rxtx.c
> b/drivers/net/intel/i40e/i40e_rxtx.c
> > index 1c3586778c..3deeff165d 100644
> > --- a/drivers/net/intel/i40e/i40e_rxtx.c
> > +++ b/drivers/net/intel/i40e/i40e_rxtx.c
> > @@ -3494,8 +3494,8 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
> > uint16_t i;
> > enum rte_vect_max_simd rx_simd_width =
> i40e_get_max_simd_bitwidth();
> >
> > - /* The primary process selects the rx path for all processes. */
> > - if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > + /* If the device has started the function has already been selected. */
> > + if (dev->data->dev_started)
> > goto out;
> >
> There is no atomic ops or mutual exclusion here, so what happens if two
> processes both call this function at the same time? Do both just get the
> same result or do we end up with some conflicts?

If two processes were to call the path selection at the same time, in
most cases they should both land on the same result. Both would be using
the same information from dev->data to build up the req_features
structure which is used as input to the path selection function. The
effect would be both writing the same values to shared variables eg.
rx_func_type in dev->data->dev_private

However I've identified two exceptions:
1. If the primary and secondary processes have different max SIMD
bitwidths configured, two different paths could be selected. However,
this is an invalid use case IMO.

2. When LLDP is enabled in iavf, the global variable
"rte_pmd_iavf_tx_lldp_dynfield_offset" is set for the process from which
it was enabled. The Tx path selection will set req_features.ctx_desc if
that variable is positive. However that variable will be different
between processes so different processes may in this case select a
different path (eg. one with a ctx desc and one without). I think adding
a bool lldp_enabled to the iavf_adapter struct can work around this.
I'll submit a v3 with this change.