From 59cfa76a22c2bcd0999a0c971219ac35ee1bc15d Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 13 Feb 2015 10:22:35 +0100 Subject: [PATCH] i40e: remove the use of UDP tunnel flag The definition of the flag PKT_TX_UDP_TUNNEL_PKT in rte_mbuf.h was: TX packet is an UDP tunneled packet. It must be specified when using outer checksum offload (PKT_TX_OUTER_IP_CKSUM) This flag was used to tell the NIC that the offload type is UDP (I40E_TXD_CTX_UDP_TUNNELING flag). In the datasheet, it says it's required to specify the tunnel type in the register. However, some tests (see [1]) showed that it also works without this flag. Moreover, it is not explained how the hardware use this information. From a network perspective, this information is useless for calculating the outer IP checksum as it does not depend on the payload. Having this flag in the API would force the application to specify the tunnel type for something that looks only useful for this PMD. It will limit the number of possible tunnel types (we would need a flag for each tunnel type) and therefore prevent to support outer IP checksum for proprietary tunnels. Finally, if a hardware advertises "I support outer IP checksum", it must be supported for any payload types. This has been validated by [2], knowing that the ipip test case was fixed after this test report [3]. [1] http://dpdk.org/ml/archives/dev/2015-January/011380.html [2] http://dpdk.org/ml/archives/dev/2015-January/011475.html [3] http://dpdk.org/ml/archives/dev/2015-January/011610.html Signed-off-by: Olivier Matz Acked-by: Jijiang Liu --- lib/librte_pmd_i40e/i40e_rxtx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c index b46746169a..d7b55d87bc 100644 --- a/lib/librte_pmd_i40e/i40e_rxtx.c +++ b/lib/librte_pmd_i40e/i40e_rxtx.c @@ -482,7 +482,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags, } /* UDP tunneling packet TX checksum offload */ - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { *td_offset |= (outer_l2_len >> 1) << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; @@ -497,7 +497,6 @@ i40e_txd_enable_checksum(uint64_t ol_flags, /* Now set the ctx descriptor fields */ *cd_tunneling |= (outer_l3_len >> 2) << I40E_TXD_CTX_QW0_EXT_IPLEN_SHIFT | - I40E_TXD_CTX_UDP_TUNNELING | (l2_len >> 1) << I40E_TXD_CTX_QW0_NATLEN_SHIFT; @@ -1165,8 +1164,7 @@ i40e_calc_context_desc(uint64_t flags) { uint64_t mask = 0ULL; - if (flags | PKT_TX_UDP_TUNNEL_PKT) - mask |= PKT_TX_UDP_TUNNEL_PKT; + mask |= PKT_TX_OUTER_IP_CKSUM; #ifdef RTE_LIBRTE_IEEE1588 mask |= PKT_TX_IEEE1588_TMST; -- 2.20.1