On 6/19/2024 11:11 AM, Chaoyong He wrote:
> From: Long Wu <long...@corigine.com>
> 
> The Rx packet type offload feature may affect the performance,
> so add a control flag for applications to turn it on or off.
> 
> Signed-off-by: Long Wu <long...@corigine.com>
> ---
>  lib/ethdev/rte_ethdev.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 548fada1c7..be86983e24 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -1555,6 +1555,7 @@ struct rte_eth_conf {
>  #define RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM  RTE_BIT64(18)
>  #define RTE_ETH_RX_OFFLOAD_RSS_HASH         RTE_BIT64(19)
>  #define RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT     RTE_BIT64(20)
> +#define RTE_ETH_RX_OFFLOAD_PTYPES           RTE_BIT64(21)
>  
>  #define RTE_ETH_RX_OFFLOAD_CHECKSUM (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | \
>                                RTE_ETH_RX_OFFLOAD_UDP_CKSUM | \

Hi Chaoyong,

Instead of having an offload for ptypes, we have APIs for this,

First one is 'rte_eth_dev_get_supported_ptypes()' that application can
learn the supported packet types.

Second one is more related to above flag, it is
'rte_eth_dev_set_ptypes()' which application can set which pytpes is
required, it can be set to disable all packet type parsing, can be
similar to not requesting 'RTE_ETH_RX_OFFLOAD_PTYPES'.

With above two APIs, do we still need the offload flag?


Another concern with adding new offload flag is backward compatibility,
all existing drivers that support packet type parsing should be updated
to list this offload flag as capability. Also they need to be updated to
configure packet parsing based on user requested offload configuration.

Briefly, we can't just introduce a new offload flag for an existing
capability and update only one driver, all drivers needs to be updated.

Reply via email to