[dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function

Andrew Rybchenko arybchenko at solarflare.com
Tue Oct 1 10:02:09 CEST 2019


On 10/1/19 10:36 AM, Pavan Nikhilesh Bhagavatula wrote:
>> -----Original Message-----
>> From: Andrew Rybchenko <arybchenko at solarflare.com>
>> Sent: Tuesday, October 1, 2019 12:34 PM
>> To: Pavan Nikhilesh Bhagavatula <pbhagavatula at marvell.com>; Jerin
>> Jacob Kollanukkaran <jerinj at marvell.com>; John McNamara
>> <john.mcnamara at intel.com>; Marko Kovacevic
>> <marko.kovacevic at intel.com>; Thomas Monjalon
>> <thomas at monjalon.net>; Ferruh Yigit <ferruh.yigit at intel.com>
>> Cc: dev at dpdk.org
>> Subject: [EXT] Re: [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype
>> function
>> On 10/1/19 9:34 AM, pbhagavatula at marvell.com wrote:
>>> From: Pavan Nikhilesh <pbhagavatula at marvell.com>
>>>
>>> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
>>> application to inform the PMD the packet types it is interested in.
>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>
>>> -If application doesn’t want any ptype information it can call
>>> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>>> RTE_PTYPE_UNKNOWN.
>>>
>>> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
>>> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>> Suggested-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>

[snip]
  

>>> +		if (ptype_mask & all_ptypes[i]) {
>> Should it be done if all_ptypes[i] have some bits out of ptype_mask?
>> Should set_ptypes have bits out of ptype_mask when set below?
>>
> Isn't all_ptypes[i] enum?. It makes sense if it's a bit mask.
> Get ptypes has a similar logic.

My bad. You're right.



More information about the dev mailing list