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: sta...@dpdk.org

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

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;
                }
-- 
2.25.1

Reply via email to