[02/13] net/bnxt: fix bad action offset in Tx bd

Message ID 20241025175738.99564-3-ajit.khaparde@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers
Series patchset for bnxt PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Oct. 25, 2024, 5:57 p.m. UTC
From: Peter Spreadborough <peter.spreadborough@broadcom.com>

This change ensures that the high part of an action table entry
offset stored in the Tx BD is set correctly. A bad value will
cause the PDCU to abort a fetch an may stall the pipeline.

Fixes: 527b10089cc5 ("net/bnxt: optimize Tx completion handling")
Cc: stable@dpdk.org

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 38f858f27f..c82b11e733 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -308,10 +308,15 @@  static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 		 */
 		txbd1->kid_or_ts_high_mss = 0;
 
-		if (txq->vfr_tx_cfa_action)
-			txbd1->cfa_action = txq->vfr_tx_cfa_action;
-		else
-			txbd1->cfa_action = txq->bp->tx_cfa_action;
+		if (txq->vfr_tx_cfa_action) {
+			txbd1->cfa_action = txq->vfr_tx_cfa_action & 0xffff;
+			txbd1->cfa_action_high = (txq->vfr_tx_cfa_action >> 16) &
+				TX_BD_LONG_CFA_ACTION_HIGH_MASK;
+		} else {
+			txbd1->cfa_action = txq->bp->tx_cfa_action & 0xffff;
+			txbd1->cfa_action_high = (txq->bp->tx_cfa_action >> 16) &
+				TX_BD_LONG_CFA_ACTION_HIGH_MASK;
+		}
 
 		if (tx_pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG ||
 		    tx_pkt->ol_flags & RTE_MBUF_F_TX_UDP_SEG) {