Resetting the outer IP checksum to 0 is not something mandated by the
mbuf API and is done by rte_eth_tx_prepare(), or per driver if needed.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: sta...@dpdk.org

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 app/test-pmd/csumonly.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 6711dda42e..f5125c2788 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -583,15 +583,17 @@ process_outer_cksums(void *outer_l3_hdr, struct 
testpmd_offload_info *info,
        uint64_t ol_flags = 0;
 
        if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4)) {
-               ipv4_hdr->hdr_checksum = 0;
                ol_flags |= RTE_MBUF_F_TX_OUTER_IPV4;
 
-               if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)
+               if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
                        ol_flags |= RTE_MBUF_F_TX_OUTER_IP_CKSUM;
-               else
+               } else {
+                       ipv4_hdr->hdr_checksum = 0;
                        ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
-       } else
+               }
+       } else {
                ol_flags |= RTE_MBUF_F_TX_OUTER_IPV6;
+       }
 
        if (info->outer_l4_proto != IPPROTO_UDP)
                return ol_flags;
-- 
2.44.0

Reply via email to