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

Reply via email to