Commit ebcfb039afa8 ("net/iavf: use common Tx path selection
infrastructure") changed the way that secondary processes selected their
Tx 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 Tx 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.

This commit also introduces logic to the secondary process probe
sequence that ensures that if a dynamic mbuf field was registered in the
primary process for LLDP, that the offset is visible in the secondary
process. This also ensures that a correct Tx path with context
descriptor support will be selected by the secondary process.

Fixes: ebcfb039afa8 ("net/iavf: use common Tx path selection infrastructure")

Signed-off-by: Ciara Loftus <[email protected]>
---
 drivers/net/intel/iavf/iavf_ethdev.c | 5 +++++
 drivers/net/intel/iavf/iavf_rxtx.c   | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_ethdev.c 
b/drivers/net/intel/iavf/iavf_ethdev.c
index 802e095174..954bce723d 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2804,6 +2804,11 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
         */
        if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
                iavf_set_rx_function(eth_dev);
+               /* LLDP may have been enabled by the primary process. Store the 
offset before
+                * setting the TX function because it may be used in the 
selection function.
+                */
+               rte_pmd_iavf_tx_lldp_dynfield_offset =
+                       rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL);
                iavf_set_tx_function(eth_dev);
                return 0;
        }
diff --git a/drivers/net/intel/iavf/iavf_rxtx.c 
b/drivers/net/intel/iavf/iavf_rxtx.c
index a47d2547dd..0d19efb94d 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -3877,8 +3877,8 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
                .simd_width = RTE_VECT_SIMD_DISABLED,
        };
 
-       /* The primary process selects the tx 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;
 
 #ifdef RTE_ARCH_X86
-- 
2.43.0

Reply via email to