From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 26EE5B3E6 for ; Fri, 13 Feb 2015 10:53:06 +0100 (CET) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YMCzU-0004Wa-0O; Fri, 13 Feb 2015 10:56:55 +0100 Message-ID: <54DDC978.8050606@6wind.com> Date: Fri, 13 Feb 2015 10:52:56 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Jijiang Liu , dev@dpdk.org References: <1423701947-17996-1-git-send-email-jijiang.liu@intel.com> <1423701947-17996-5-git-send-email-jijiang.liu@intel.com> In-Reply-To: <1423701947-17996-5-git-send-email-jijiang.liu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 4/4] app/testpmd:test NVGRE Tx checksum offload X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 09:53:06 -0000 Hi Jijiang, On 02/12/2015 01:45 AM, Jijiang Liu wrote: > Enhance csum fwd engine based on current TX checksum framework in order to test TX Checksum offload for NVGRE packet. > > It includes: > - IPv4 and IPv6 packet > - outer L3, inner L3 and L4 checksum offload for Tx side. > > [...] > @@ -231,20 +235,25 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) > struct ether_hdr *eth_hdr; > struct ipv4_hdr *ipv4_hdr; > struct ipv6_hdr *ipv6_hdr; > + uint8_t gre_len = 0; > > - /* if flags != 0; it's not supported */ > - if (gre_hdr->flags != 0) > + /* check which fields are supported */ > + if (gre_hdr->flags != 0 && > + (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; > + I think this test won't work if the flags contains both supported and unsupported flags. What about this instead: if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0) return; Regards, Olivier