[dpdk-dev] [PATCH 13/20] testpmd: support gre tunnels in csum fwd engine

Olivier MATZ olivier.matz at 6wind.com
Mon Feb 2 14:30:58 CET 2015


Hi Jijiang,

On 02/02/2015 02:16 PM, Liu, Jijiang wrote:
>>> For NVGRE:
>>> I will do some change here.
>>> eth_hdr = (struct ether_hdr *)((char *)gre_hdr +
>>> 		sizeof(struct nvgre_hdr)); // replace  simple_gre_hdr with
>> nvgre_hdr.
>>>
>>
>> I think replacing gre_hdr by nvgre_hdr here would break the gre.
>> If we want to support NVGRE, I think we should check the value of gre_hdr-
>>> flags to determine the length of the gre header.
>>
>> I'm not a NVGRE expert, but from what I've seen NVGRE is just a GRE header
>> with the key flag present.
> 
>  NVGRE frame format in section 3.2
> http://datatracker.ietf.org/doc/draft-sridharan-virtualization-nvgre/?include_text=1
> 
> When gre_hdr->proto = htons (0x6558),  which means this is NVGRE protocol( MAC over GRE), the key flag must be present, so gre_hdr->flags != 0.
> 
> Anyway,  the following check should be removed when we support NVGRE TX checksum offload later, or it will failed.
> 
> 	/* if flags != 0; it's not supported */
>               if (gre_hdr->flags != 0)
> 		return;

Yes, what I'm saying is that we need to replace it by something like:

	gre_len = sizeof(*gre);

	/* replaces "if (gre->flags != 0)" */
	if ((gre->flags & UNSUPPORTED_FLAGS) != 0)
		return;

	if (gre->flags & KEY)
		gre_len += 4;


If the key flag is mandatory in key flag is mandatory in case of
Ethernet over GRE, this should be checked after.

Regards,
Olivier


More information about the dev mailing list