DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [dpdk-dev 1/2] lib: fix ipv6 tunnel csum issue
@ 2017-04-05  4:48 Jeff Guo
  2017-04-05  4:48 ` [dpdk-dev] [dpdk-dev 2/2] app/testpmd: " Jeff Guo
  2017-04-10 20:50 ` [dpdk-dev] [dpdk-dev 1/2] lib: " Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Guo @ 2017-04-05  4:48 UTC (permalink / raw)
  To: helin.zhang, jingjing.wu; +Cc: dev, jia.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>
---
 lib/librte_net/rte_net.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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) {
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [dpdk-dev 2/2] app/testpmd: fix ipv6 tunnel csum issue
  2017-04-05  4:48 [dpdk-dev] [dpdk-dev 1/2] lib: fix ipv6 tunnel csum issue Jeff Guo
@ 2017-04-05  4:48 ` Jeff Guo
  2017-04-10 20:50 ` [dpdk-dev] [dpdk-dev 1/2] lib: " Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Guo @ 2017-04-05  4:48 UTC (permalink / raw)
  To: helin.zhang, jingjing.wu; +Cc: dev, jia.guo

When ipv6 packet is tunnel packet, "PKT_TX_OUTER_IPV6" flag must
be set, to let prepare the correct mbuf meta data for tx forward.

Fixes: 2b76648872c9 ("net/e1000: add Tx preparation")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 app/test-pmd/csumonly.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 88cc842..7f8f8a5 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -417,7 +417,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 			ol_flags |= PKT_TX_OUTER_IP_CKSUM;
 		else
 			ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
-	} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
+	} else
 		ol_flags |= PKT_TX_OUTER_IPV6;
 
 	if (info->outer_l4_proto != IPPROTO_UDP)
@@ -756,7 +756,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		if (info.is_tunnel == 1) {
 			if (info.tunnel_tso_segsz ||
-			    testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
+			    (testpmd_ol_flags &
+			    TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
+			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
@@ -826,8 +828,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 					"m->l4_len=%d\n",
 					m->l2_len, m->l3_len, m->l4_len);
 			if (info.is_tunnel == 1) {
-				if (testpmd_ol_flags &
-				    TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
+				if ((testpmd_ol_flags &
+				    TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
+				    (tx_ol_flags & PKT_TX_OUTER_IPV6))
 					printf("tx: m->outer_l2_len=%d "
 						"m->outer_l3_len=%d\n",
 						m->outer_l2_len,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [dpdk-dev 1/2] lib: fix ipv6 tunnel csum issue
  2017-04-05  4:48 [dpdk-dev] [dpdk-dev 1/2] lib: fix ipv6 tunnel csum issue Jeff Guo
  2017-04-05  4:48 ` [dpdk-dev] [dpdk-dev 2/2] app/testpmd: " Jeff Guo
@ 2017-04-10 20:50 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-04-10 20:50 UTC (permalink / raw)
  To: Jeff Guo; +Cc: dev, helin.zhang, jingjing.wu, stable

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-10 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05  4:48 [dpdk-dev] [dpdk-dev 1/2] lib: fix ipv6 tunnel csum issue Jeff Guo
2017-04-05  4:48 ` [dpdk-dev] [dpdk-dev 2/2] app/testpmd: " Jeff Guo
2017-04-10 20:50 ` [dpdk-dev] [dpdk-dev 1/2] lib: " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).