[dpdk-dev] supported packet types

Olivier Matz olivier.matz at 6wind.com
Tue Jun 21 10:58:43 CEST 2016


Hi Konstantin,

On 06/16/2016 01:29 PM, Ananyev, Konstantin wrote:
>>>> I suggest instead to set the ptype
>>>> in an opportunistic fashion instead:
>>>> - if the driver/hw knows the ptype, set it
>>>> - else, set it to unknown
>>>
>>> That's what PMD does now... and I don't think it can do much more -
>>> only interpret information provided by the HW in a proper way.
>>> Probably I misunderstood you here...
>>
>> My suggestion was to remove get_supported_ptypes an set the ptype in
>> mbuf when the pmd recognize a type.
>>
>> But we could also keep get_supported_ptypes() for ptypes that will
>> always be recognized, allowing a PMD to set any other ptype if it
>> is recognized. This is probably what we have today in some PMDs, I
>> think it just requires some clarification.
> 
> Yes, +1 to the second option.

What about the following API comment?

'''
Retrieve the supported packet types of an Ethernet device.

When a packet type is announced as supported, it *must* be recognized by
the PMD. For instance, if RTE_PTYPE_L2_ETHER, RTE_PTYPE_L2_ETHER_VLAN
and RTE_PTYPE_L3_IPV4 are announced, the PMD must return the following
packet types for these packets:
- Ether/IPv4              -> RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4
- Ether/Vlan/IPv4         -> RTE_PTYPE_L2_ETHER_VLAN | RTE_PTYPE_L3_IPV4
- Ether/<anything else>   -> RTE_PTYPE_L2_ETHER
- Ether/Vlan/<anything else> -> RTE_PTYPE_L2_ETHER_VLAN

When a packet is received by a PMD, the most precise type must be
returned among the ones supported. However a PMD is allowed to set
packet type that is not in the supported list, at the condition that it
is more precise. Therefore, a PMD announcing no supported packet types
can still set a matching packet type in a received packet.
'''

If it's fine I'll submit it as a patch.

Regards,
Olivier


More information about the dev mailing list