In case some CPUs don't support AVX512. Enable AVX2 for them to
get better per-core performance.

In the single queue model, the same descriptor queue is used by SW
to post descriptors to the device and used by device to report completed
descriptors to SW. While as the split queue model separates them into
different queues for parallel processing and improved performance.

Signed-off-by: Shaiq Wani <[email protected]>
---
 drivers/net/intel/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/intel/idpf/idpf_rxtx.c        | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/intel/idpf/idpf_common_rxtx.h 
b/drivers/net/intel/idpf/idpf_common_rxtx.h
index 87f6895c4c..3636d55272 100644
--- a/drivers/net/intel/idpf/idpf_common_rxtx.h
+++ b/drivers/net/intel/idpf/idpf_common_rxtx.h
@@ -264,6 +264,9 @@ uint16_t idpf_dp_singleq_recv_pkts_avx2(void *rx_queue,
                                        struct rte_mbuf **rx_pkts,
                                        uint16_t nb_pkts);
 __rte_internal
+uint16_t idpf_dp_splitq_xmit_pkts_avx2(void *tx_queue, struct rte_mbuf 
**tx_pkts,
+                                      uint16_t nb_pkts);
+__rte_internal
 uint16_t idpf_dp_singleq_xmit_pkts_avx2(void *tx_queue,
                                        struct rte_mbuf **tx_pkts,
                                        uint16_t nb_pkts);
diff --git a/drivers/net/intel/idpf/idpf_rxtx.c 
b/drivers/net/intel/idpf/idpf_rxtx.c
index 1c725065df..6950fabb49 100644
--- a/drivers/net/intel/idpf/idpf_rxtx.c
+++ b/drivers/net/intel/idpf/idpf_rxtx.c
@@ -850,6 +850,15 @@ idpf_set_tx_function(struct rte_eth_dev *dev)
                                return;
                        }
 #endif /* CC_AVX512_SUPPORT */
+                       if (tx_simd_width == RTE_VECT_SIMD_256) {
+                               PMD_DRV_LOG(NOTICE,
+                                           "Using Split AVX2 Vector Tx (port 
%d).",
+                                           dev->data->port_id);
+                               dev->tx_pkt_burst = 
idpf_dp_splitq_xmit_pkts_avx2;
+                               dev->tx_pkt_prepare = idpf_dp_prep_pkts;
+                               return;
+                       }
+
                }
                PMD_DRV_LOG(NOTICE,
                            "Using Split Scalar Tx (port %d).",
-- 
2.34.1

Reply via email to