[PATCH] net/sfc: avoid unnecessary flow pattern item traversal

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Tue Feb 14 14:39:39 CET 2023


On 2/14/23 16:27, Ivan Malov wrote:
> Currently, the code tries to look up a user-provided item
> by traversing those known to the PMD. Avoid the traversal
> since it is easier to access items directly by their IDs,
> with necessary checks to avoid reading past the buffer.
> 
> Signed-off-by: Ivan Malov <ivan.malov at arknetworks.am>
> Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov at arknetworks.am>
> Reviewed-by: Andy Moreton <amoreton at xilinx.com>
> ---
>   drivers/net/sfc/sfc_flow.c | 60 +++++++++++---------------------------
>   drivers/net/sfc/sfc_flow.h |  1 -
>   drivers/net/sfc/sfc_mae.c  | 39 +++++++++----------------
>   3 files changed, 30 insertions(+), 70 deletions(-)
> 
> diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
> index fe1f5ba55f..9e1b746d51 100644
> --- a/drivers/net/sfc/sfc_flow.c
> +++ b/drivers/net/sfc/sfc_flow.c
> @@ -1130,96 +1130,84 @@ sfc_flow_parse_pppoex(const struct rte_flow_item *item,
>   }
>   
>   static const struct sfc_flow_item sfc_flow_items[] = {
> -	{
> -		.type = RTE_FLOW_ITEM_TYPE_VOID,
> +	[RTE_FLOW_ITEM_TYPE_VOID] = {

Doesn't it make these arrays sparse and potentially too big?
I'd like to see mitigation of the question in the changeset
description.



More information about the dev mailing list