On 10/1/19 10:36 AM, Pavan Nikhilesh Bhagavatula wrote:
-----Original Message-----
From: Andrew Rybchenko <arybche...@solarflare.com>
Sent: Tuesday, October 1, 2019 12:34 PM
To: Pavan Nikhilesh Bhagavatula <pbhagavat...@marvell.com>; Jerin
Jacob Kollanukkaran <jer...@marvell.com>; John McNamara
<john.mcnam...@intel.com>; Marko Kovacevic
<marko.kovace...@intel.com>; Thomas Monjalon
<tho...@monjalon.net>; Ferruh Yigit <ferruh.yi...@intel.com>
Cc: dev@dpdk.org
Subject: [EXT] Re: [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype
function
On 10/1/19 9:34 AM, pbhagavat...@marvell.com wrote:
From: Pavan Nikhilesh <pbhagavat...@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.anan...@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavat...@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.

Reply via email to