From ff8b8bcd2ebef5d951bf442c44a71b0b3a0413c9 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Mon, 22 Nov 2021 15:30:00 +0000 Subject: [PATCH] net/iavf: fix segmentation offload condition Apply segmentation offload when requested for non tunneled packets e.g. IPsec transport mode. Fixes: 1e728b01120c ("net/iavf: rework Tx path") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau Reviewed-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 59623ac820..94819e59b2 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2428,10 +2428,9 @@ iavf_fill_data_desc(volatile struct iavf_tx_desc *desc, desc->buffer_addr = rte_mbuf_data_iova(m); /* calculate data buffer size less set header lengths */ - if ((m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) && - (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | - RTE_MBUF_F_TX_UDP_SEG))) { - hdrlen += m->outer_l3_len; + if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { + if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) + hdrlen += m->outer_l3_len; if (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) hdrlen += m->l3_len + m->l4_len; else