From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 9F2951B8E1 for ; Tue, 10 Apr 2018 15:00:59 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 10 Apr 2018 16:02:06 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w3AD0tHo029937; Tue, 10 Apr 2018 16:00:56 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w3AD0txM188892; Tue, 10 Apr 2018 21:00:55 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w3AD0tvA188891; Tue, 10 Apr 2018 21:00:55 +0800 From: Xueming Li To: Wenzhuo Lu , Jingjing Wu , Thomas Monjalon Cc: Xueming Li , Nelio Laranjeiro , Shahaf Shuler , dev@dpdk.org, Olivier Matz Date: Tue, 10 Apr 2018 21:00:36 +0800 Message-Id: <20180410130036.188819-6-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180410130036.188819-1-xuemingl@mellanox.com> References: <20180410130036.188819-1-xuemingl@mellanox.com> In-Reply-To: <20180226150947.107179-2-xuemingl@mellanox.com> References: <20180226150947.107179-2-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v2 5/5] app/testpmd: add more GRE extension support to csum engine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:01:00 -0000 This patch adds GRE checksum and sequence extension supports in addtion to key extension to csum forwarding engine. Signed-off-by: Xueming Li --- app/test-pmd/csumonly.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 213888374..b73b8fe68 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 @@ -269,14 +272,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; @@ -815,6 +818,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 & -- 2.13.3