Skip to contentSkip to conversation

net/ice: ensure correct vector flag after reconfiguration

PATCH In review Bruce Richardson 2 participants 3 messages Jan 28 – Jan 29 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: ensure correct vector flag after reconfiguration

After configuring the Tx path to be used, the ice driver sets the tx_vec_allowed flag if a vector path is chosen. However, on reconfiguration, the flag is not cleared if a scalar path is chosen, leading to crashes on driver shutdown as the wrong cleanup function would be used in that case. Fix issue, by always setting the flag to true or false explicitly.

Fixes d3206e40c435 ("net/ice: use common Tx path selection infrastructure")
---
 drivers/net/intel/ice/ice_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/ice/ice_rxtx.c +2 -2
index 59ff4c31c8..816733819f 100644
@@ -3721,8 +3721,8 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 						ICE_TX_DEFAULT);
 
 out:
-	if (ice_tx_path_infos[ad->tx_func_type].features.simd_width >= RTE_VECT_SIMD_256)
-		ad->tx_vec_allowed = true;
+	ad->tx_vec_allowed =
+		(ice_tx_path_infos[ad->tx_func_type].features.simd_width >= RTE_VECT_SIMD_256);
 
 	dev->tx_pkt_burst = mbuf_check ? ice_xmit_pkts_check :
 					 ice_tx_path_infos[ad->tx_func_type].pkt_burst;
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

Subject: [PATCH] net/ice: ensure correct vector flag after reconfiguration

After configuring the Tx path to be used, the ice driver sets the tx_vec_allowed flag if a vector path is chosen. However, on reconfiguration, the flag is not cleared if a scalar path is chosen, leading to crashes on driver shutdown as the wrong cleanup function would be used in that case. Fix issue, by always setting the flag to true or false explicitly.

Quoted 3 lines
Fixes d3206e40c435 ("net/ice: use common Tx path selection infrastructure")

Thanks for catching this Bruce.

Quoted 24 lines
---
 drivers/net/intel/ice/ice_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/ice/ice_rxtx.c +2 -2
index 59ff4c31c8..816733819f 100644
@@ -3721,8 +3721,8 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 						ICE_TX_DEFAULT);
 
 out:
-	if (ice_tx_path_infos[ad->tx_func_type].features.simd_width >=
 RTE_VECT_SIMD_256)
-		ad->tx_vec_allowed = true;
+	ad->tx_vec_allowed =
+		(ice_tx_path_infos[ad->tx_func_type].features.simd_width >=
 RTE_VECT_SIMD_256);
 
drivers/net/intel/ice/ice_rxtx.c +0 -0
 	dev->tx_pkt_burst = mbuf_check ? ice_xmit_pkts_check :
 					 ice_tx_path_infos[ad-
Quoted 1 line

tx_func_type].pkt_burst;

--
2.51.0

#2 lore raw
Quoted 9 lines · Ciara
Quoted 9 lines

Subject: [PATCH] net/ice: ensure correct vector flag after reconfiguration

After configuring the Tx path to be used, the ice driver sets the tx_vec_allowed flag if a vector path is chosen. However, on reconfiguration, the flag is not cleared if a scalar path is chosen, leading to crashes on driver shutdown as the wrong cleanup function would be used in that case. Fix issue, by always setting the flag to true or false explicitly.

Quoted 8 lines
Quoted 3 lines
Fixes d3206e40c435 ("net/ice: use common Tx path selection infrastructure")

Thanks for catching this Bruce.

Squashed to original commit on next-net-intel-tree