[dpdk-dev,dpdk-dev,1/2] lib: fix ipv6 tunnel csum issue

Message ID 1491367723-53124-1-git-send-email-jia.guo@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Guo, Jia April 5, 2017, 4:48 a.m. UTC
When packet is flag of "PKT_TX_OUTER_IPV6", it also need to be 
considered to be tunnel case, in order to calculate the correct
csum value.

Fixes: 2b76648872c9 ("net/e1000: add Tx preparation")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 lib/librte_net/rte_net.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon April 10, 2017, 8:50 p.m. UTC | #1
2017-04-05 12:48, Jeff Guo:
> When packet is flag of "PKT_TX_OUTER_IPV6", it also need to be 
> considered to be tunnel case, in order to calculate the correct
> csum value.
> 
> Fixes: 2b76648872c9 ("net/e1000: add Tx preparation")
> Signed-off-by: Jeff Guo <jia.guo@intel.com>

Series applied, thanks
  

Patch

diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
index 548eaed..79c764a 100644
--- a/lib/librte_net/rte_net.h
+++ b/lib/librte_net/rte_net.h
@@ -120,7 +120,8 @@  rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	struct udp_hdr *udp_hdr;
 	uint64_t inner_l3_offset = m->l2_len;
 
-	if (ol_flags & PKT_TX_OUTER_IP_CKSUM)
+	if ((ol_flags & PKT_TX_OUTER_IP_CKSUM) ||
+		(ol_flags & PKT_TX_OUTER_IPV6))
 		inner_l3_offset += m->outer_l2_len + m->outer_l3_len;
 
 	if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) {