Skip to contentSkip to conversation

net/iavf: remove reset of Tx prepare function ptr

PATCH In review Bruce Richardson 2 participants 3 messages Dec 13, 2024 – Jan 20, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: remove reset of Tx prepare function ptr

The iavf driver only contains a single Tx prepare function, so when selecting the Tx path, there is no need to reset and reassign the function pointer in the ethdev structure. This fixes an issue where the pointer was reset to NULL, but never assigned back later on function selection.

Fixes 5712bf9d6e14 ("net/iavf: add Tx AVX2 offload path")
Fixes 08eb6a9cc2e1 ("net/iavf: fix Tx L4 checksum")
Fixes 4f8259df563a ("net/iavf: enable Tx outer checksum offload on AVX512")
---
 drivers/net/iavf/iavf_rxtx.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/iavf/iavf_rxtx.c +0 -6
index 6a093c6746..98a1d3f69d 100644
@@ -4173,7 +4173,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 		if (!use_sse && !use_avx2 && !use_avx512)
 			goto normal;
 
-		dev->tx_pkt_prepare = NULL;
 		if (use_sse) {
 			PMD_DRV_LOG(DEBUG, "Using Vector Tx (port %d).",
 				    dev->data->port_id);
@@ -4190,7 +4189,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 				goto normal;
 			} else {
 				tx_burst_type = IAVF_TX_AVX2_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
 				PMD_DRV_LOG(DEBUG, "Using AVX2 OFFLOAD Vector Tx (port %d).",
 					    dev->data->port_id);
 			}
@@ -4203,17 +4201,14 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 					    dev->data->port_id);
 			} else if (check_ret == IAVF_VECTOR_OFFLOAD_PATH) {
 				tx_burst_type = IAVF_TX_AVX512_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
 				PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).",
 					    dev->data->port_id);
 			} else if (check_ret == IAVF_VECTOR_CTX_PATH) {
 				tx_burst_type = IAVF_TX_AVX512_CTX;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
 				PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).",
 						dev->data->port_id);
 			} else {
 				tx_burst_type = IAVF_TX_AVX512_CTX_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
 				PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT OFFLOAD Vector Tx (port %d).",
 					    dev->data->port_id);
 			}
@@ -4251,7 +4246,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 	PMD_DRV_LOG(DEBUG, "Using Basic Tx callback (port=%d).",
 		    dev->data->port_id);
 	tx_burst_type = IAVF_TX_DEFAULT;
-	dev->tx_pkt_prepare = iavf_prep_pkts;
 
 	if (no_poll_on_link_down) {
 		adapter->tx_burst_type = tx_burst_type;
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 55 lines · Bruce Richardson

The iavf driver only contains a single Tx prepare function, so when selecting the Tx path, there is no need to reset and reassign the function pointer in the ethdev structure. This fixes an issue where the pointer was reset to NULL, but never assigned back later on function selection.

Fixes 5712bf9d6e14 ("net/iavf: add Tx AVX2 offload path")
Fixes 08eb6a9cc2e1 ("net/iavf: fix Tx L4 checksum")
Fixes 4f8259df563a ("net/iavf: enable Tx outer checksum offload on AVX512")
---
  drivers/net/iavf/iavf_rxtx.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/net/iavf/iavf_rxtx.c +0 -5
index 6a093c6746..98a1d3f69d 100644
@@ -4173,7 +4173,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
  		if (!use_sse && !use_avx2 && !use_avx512)
  			goto normal;
 
-		dev->tx_pkt_prepare = NULL;
  		if (use_sse) {
  			PMD_DRV_LOG(DEBUG, "Using Vector Tx (port %d).",
  				    dev->data->port_id);
@@ -4190,7 +4189,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
  				goto normal;
  			} else {
  				tx_burst_type = IAVF_TX_AVX2_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
  				PMD_DRV_LOG(DEBUG, "Using AVX2 OFFLOAD Vector Tx (port %d).",
  					    dev->data->port_id);
  			}
@@ -4203,17 +4201,14 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
  					    dev->data->port_id);
  			} else if (check_ret == IAVF_VECTOR_OFFLOAD_PATH) {
  				tx_burst_type = IAVF_TX_AVX512_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
  				PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).",
  					    dev->data->port_id);
  			} else if (check_ret == IAVF_VECTOR_CTX_PATH) {
  				tx_burst_type = IAVF_TX_AVX512_CTX;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
  				PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).",
  						dev->data->port_id);
  			} else {
  				tx_burst_type = IAVF_TX_AVX512_CTX_OFFLOAD;
-				dev->tx_pkt_prepare = iavf_prep_pkts;
  				PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT OFFLOAD Vector Tx (port %d).",
  					    dev->data->port_id);
  			}

drivers/net/iavf/iavf_rxtx.c iavf_set_tx_function(struct rte_eth_dev *dev) · line 4251

Quoted 7 lines
drivers/net/iavf/iavf_rxtx.c +0 -1
@@ -4251,7 +4246,6 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
  	PMD_DRV_LOG(DEBUG, "Using Basic Tx callback (port=%d).",
  		    dev->data->port_id);
  	tx_burst_type = IAVF_TX_DEFAULT;
-	dev->tx_pkt_prepare = iavf_prep_pkts;
 
  	if (no_poll_on_link_down) {
  		adapter->tx_burst_type = tx_burst_type;
Signature · 2 lines
Regards,
Vladimir
author Applied
#2 lore raw
Quoted 17 lines · Vladimir
Quoted 16 lines · Bruce Richardson

The iavf driver only contains a single Tx prepare function, so when selecting the Tx path, there is no need to reset and reassign the function pointer in the ethdev structure. This fixes an issue where the pointer was reset to NULL, but never assigned back later on function selection.

Fixes 5712bf9d6e14 ("net/iavf: add Tx AVX2 offload path")
Fixes 08eb6a9cc2e1 ("net/iavf: fix Tx L4 checksum")
Fixes 4f8259df563a ("net/iavf: enable Tx outer checksum offload on AVX512")
---
  drivers/net/iavf/iavf_rxtx.c | 6 ------
  1 file changed, 6 deletions(-)

<snip>

Quoted 5 lines

drivers/net/iavf/iavf_rxtx.c iavf_set_tx_function(struct rte_eth_dev *dev) · line 4251

Quoted 3 lines
drivers/net/iavf/iavf_rxtx.c +0 -1
-	dev->tx_pkt_prepare = iavf_prep_pkts;
  	if (no_poll_on_link_down) {
  		adapter->tx_burst_type = tx_burst_type;

Applied to dpdk-next-net-intel.

/Bruce