[v2] net/axgbe: invoke correct API when offloads enabled

Message ID 20231114071530.466675-1-jesna.k.e@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/axgbe: invoke correct API when offloads enabled |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-testing fail build patch failure
ci/github-robot: build fail github build: failed
ci/Intel-compilation fail Compilation issues

Commit Message

Jesna K E Nov. 14, 2023, 7:15 a.m. UTC
  A bug was introduced with the recent fix that when
an offload feature is enabled axgbe_xmit_pkts_vec API is called
rather than axgbe_xmit_pkts API.This patch fixes it.

Fixes: 9963b5131af8 ("net/axgbe: support multi-process")

Signed-off-by: Jesna K E <jesna.k.e@amd.com>
---
 drivers/net/axgbe/axgbe_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index 3717166384..7a57418767 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -12,6 +12,8 @@ 
 
 #include "eal_filesystem.h"
 
+#include <rte_vect.h>
+
 #ifdef RTE_ARCH_X86
 #include <cpuid.h>
 #else
@@ -2137,15 +2139,15 @@  axgbe_set_tx_function(struct rte_eth_dev *dev)
 {
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	dev->tx_pkt_burst = &axgbe_xmit_pkts;
+
 	if (pdata->multi_segs_tx)
 		dev->tx_pkt_burst = &axgbe_xmit_pkts_seg;
 #ifdef RTE_ARCH_X86
 	struct axgbe_tx_queue *txq = dev->data->tx_queues[0];
-	if (!txq->vector_disable &&
+	else if (!txq->vector_disable &&
 			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128)
 		dev->tx_pkt_burst = &axgbe_xmit_pkts_vec;
-#else
-	dev->tx_pkt_burst = &axgbe_xmit_pkts;
 #endif
 }