[07/10] net/cnxk: fix issue with outbound security higher pkt burst

Message ID 20240517074448.3146611-7-ndabilpuram@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Jerin Jacob
Headers
Series [01/10] common/cnxk: sync VF root weight with kernel |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram May 17, 2024, 7:44 a.m. UTC
  Fix issue with outbound security path while handling mixed traffic i.e
both plain and inline outbound pkts being present as part of burst
and burst size is > 32. The loop needs to be broken when
we don't have space for 4 pkts in LMT lines for CPT considering
both the full lmt lines and partial lmt lines used.

Fixes: 55bfac717c72 ("net/cnxk: support Tx security offload on cn10k")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 3818b0445a..84b08403c0 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -2272,7 +2272,8 @@  cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
 	}
 
 	for (i = 0; i < burst; i += NIX_DESCS_PER_LOOP) {
-		if (flags & NIX_TX_OFFLOAD_SECURITY_F && c_lnum + 2 > 16) {
+		if (flags & NIX_TX_OFFLOAD_SECURITY_F &&
+		    (((int)((16 - c_lnum) << 1) - c_loff) < 4)) {
 			burst = i;
 			break;
 		}