Fix the Tx path and Tx descriptor usage in order
to make the Tx offload flags and Tx data descriptor
consistent.

Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: sta...@dpdk.org

Signed-off-by: Ke Zhang <ke1x.zh...@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 109ba756f8..dfd021889e 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2538,9 +2538,11 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t 
*qw1,
        offset |= (m->l2_len >> 1) << IAVF_TX_DESC_LENGTH_MACLEN_SHIFT;
 
        /* Enable L3 checksum offloading inner */
-       if (m->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4)) {
-               command |= IAVF_TX_DESC_CMD_IIPT_IPV4_CSUM;
-               offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
+       if (m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+               if (m->ol_flags & RTE_MBUF_F_TX_IPV4) {
+                       command |= IAVF_TX_DESC_CMD_IIPT_IPV4_CSUM;
+                       offset |= (m->l3_len >> 2) << 
IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
+               }
        } else if (m->ol_flags & RTE_MBUF_F_TX_IPV4) {
                command |= IAVF_TX_DESC_CMD_IIPT_IPV4;
                offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
-- 
2.25.1

Reply via email to