[dpdk-dev,v4,3/4] app/testpmd: add more GRE extension to csum engine

Message ID 20180408123240.110698-4-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Xueming Li April 8, 2018, 12:32 p.m. UTC
  This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 app/test-pmd/csumonly.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
  

Comments

Thomas Monjalon April 16, 2018, 10:45 p.m. UTC | #1
08/04/2018 14:32, Xueming Li:
> This patch adds GRE checksum and sequence extension supports in addtion
> to key extension to csum forwarding engine.
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

This patch is also part of another series, isn't it?
("introduce new tunnel types")
  
Xueming Li April 17, 2018, 5:19 a.m. UTC | #2
> -----Original Message-----

> From: Thomas Monjalon <thomas@monjalon.net>

> Sent: Tuesday, April 17, 2018 6:45 AM

> To: Xueming(Steven) Li <xuemingl@mellanox.com>

> Cc: dev@dpdk.org; Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Yongseok Koh

> <yskoh@mellanox.com>; Olivier MATZ <olivier.matz@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;

> Ferruh Yigit <ferruh.yigit@intel.com>

> Subject: Re: [dpdk-dev] [PATCH v4 3/4] app/testpmd: add more GRE extension to csum engine

> 

> 08/04/2018 14:32, Xueming Li:

> > This patch adds GRE checksum and sequence extension supports in

> > addtion to key extension to csum forwarding engine.

> >

> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>

> 

> This patch is also part of another series, isn't it?

> ("introduce new tunnel types")

> 


Good catch, it was there for test purpose, I'll remove this one and the next.
  

Patch

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 7b2309372..00ec40d58 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@ 
 #define IP_HDRLEN  0x05 /* default IP header length == five 32-bits words. */
 #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
 
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN     4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT	0x8000
+#define GRE_KEY_PRESENT		0x2000
+#define GRE_SEQUENCE_PRESENT	0x1000
+#define GRE_EXT_LEN		4
+#define GRE_SUPPORTED_FIELDS	(GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+				 GRE_SEQUENCE_PRESENT)
 
 /* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -203,14 +206,14 @@  parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
 	struct ipv6_hdr *ipv6_hdr;
 	uint8_t gre_len = 0;
 
-	/* check which fields are supported */
-	if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
-		return;
-
 	gre_len += sizeof(struct simple_gre_hdr);
 
 	if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
-		gre_len += GRE_KEY_LEN;
+		gre_len += GRE_EXT_LEN;
+	if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+		gre_len += GRE_EXT_LEN;
+	if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+		gre_len += GRE_EXT_LEN;
 
 	if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
 		info->is_tunnel = 1;
@@ -739,6 +742,7 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		/* step 3: fill the mbuf meta data (flags and header lengths) */
 
+		m->tx_offload = 0;
 		if (info.is_tunnel == 1) {
 			if (info.tunnel_tso_segsz ||
 			    (tx_offloads &