ethdev: add packet type range function
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Mon, 11 Nov 2019 13:19:05 +0000 (18:49 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Nov 2019 15:15:36 +0000 (16:15 +0100)
commit5d4813acda2c3122c8efc95e600890bad4dc515b
tree68d76d04a2e81c28ac78cdaf6d1e556f912c1504
parent328dc5baa767e869417e96695b1f4a80c1dcc166
ethdev: add packet type range function

Add `rte_eth_dev_set_ptypes` function that will allow the application
to inform the PMD about reduced range of packet types to handle.
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_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_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_ptypes(ethdev_id,
RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
doc/guides/nics/features.rst
doc/guides/rel_notes/release_19_11.rst
lib/librte_ethdev/rte_ethdev.c
lib/librte_ethdev/rte_ethdev.h
lib/librte_ethdev/rte_ethdev_core.h
lib/librte_ethdev/rte_ethdev_version.map