From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v2 4/4] app/testpmd:test NVGRE Tx checksum offload Date: Fri, 13 Feb 2015 10:52:56 +0100 Message-ID: <54DDC978.8050606@6wind.com> References: <1423701947-17996-1-git-send-email-jijiang.liu@intel.com> <1423701947-17996-5-git-send-email-jijiang.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Jijiang Liu , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1423701947-17996-5-git-send-email-jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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