[dpdk-dev] [PATCH 01/17] mbuf: add definitions of unified packet types

Olivier MATZ olivier.matz at 6wind.com
Tue Feb 3 10:12:10 CET 2015


Hi Helin,

On 02/03/2015 07:37 AM, Zhang, Helin wrote:
>>> When your application decapsulates tunnels, you can just do outer =
>>> inner and enter into the same code.
>> Expanding packet_type is not easy, as there is no free bits in the first cache
>> line.
>> Is there any tunnel type in inner packet? Is it a waste?
>> Is L2 type really needed? I don't know.
> If it is now not short of space in mbuf, the definition as yours might be good.
> But tun_type is not required for inner packet, I'd prefer to define it as needed
> with taking into account the Vector PMD support. It seems 32 bits might be enough,
> like below,
> struct pkt_type {
> 	uint32_t l2_type:4;
> 	uint32_t l3_type:4;
> 	uint32_t l4_type:4;
> 	uint32_t tun_type:4;
> 	uint32_t inner_l2_type:4;
> 	uint32_t inner_l3_type:4;
> 	uint32_t inner_l4_type:4;
> }

Yes, I think a structure like this would be much better!
Maybe a union with a u32 could also help to assign the value
in one operation.

Thanks,
Olivier



More information about the dev mailing list