> -----Original Message-----
> From: Slava Ovsiienko <viachesl...@nvidia.com>
> Sent: Wednesday, September 18, 2024 15:46
> To: dev@dpdk.org
> Cc: Matan Azrad <ma...@nvidia.com>; Raslan Darawsheh
> <rasl...@nvidia.com>; Ori Kam <or...@nvidia.com>; Dariusz Sosnowski
> <dsosnow...@nvidia.com>
> Subject: [PATCH v2 2/9] net/mlx5: add flex item query tunnel mode routine
>
> Once parsing the RTE item array the PMD needs to know whether the flex item
> represents the tunnel header.
> The appropriate tunnel mode query API is added.
>
> Signed-off-by: Viacheslav Ovsiienko <viachesl...@nvidia.com>
> ---
> drivers/net/mlx5/mlx5.h | 2 ++
> drivers/net/mlx5/mlx5_flow_flex.c | 27 +++++++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index
> 869aac032b..6d163996e4 100644
> --- a/drivers/net/mlx5/mlx5.h
> +++ b/drivers/net/mlx5/mlx5.h
> @@ -2605,6 +2605,8 @@ int mlx5_flex_get_sample_id(const struct
> mlx5_flex_item *tp, int mlx5_flex_get_parser_value_per_byte_off(const struct
> rte_flow_item_flex *item,
> void *flex, uint32_t byte_off,
> bool is_mask, bool tunnel,
> uint32_t *value);
> +int mlx5_flex_get_tunnel_mode(const struct rte_flow_item *item,
> + enum rte_flow_item_flex_tunnel_mode
> *tunnel_mode);
> int mlx5_flex_acquire_index(struct rte_eth_dev *dev,
> struct rte_flow_item_flex_handle *handle,
> bool acquire);
> diff --git a/drivers/net/mlx5/mlx5_flow_flex.c
> b/drivers/net/mlx5/mlx5_flow_flex.c
> index 5b104d583c..0c41b956b0 100644
> --- a/drivers/net/mlx5/mlx5_flow_flex.c
> +++ b/drivers/net/mlx5/mlx5_flow_flex.c
> @@ -291,6 +291,33 @@ mlx5_flex_get_parser_value_per_byte_off(const struct
> rte_flow_item_flex *item,
> return 0;
> }
>
> +/**
> + * Get the flex parser tunnel mode.
> + *
> + * @param[in] item
> + * RTE Flex item.
> + * @param[in, out] tunnel_mode
> + * Pointer to return tunnel mode.
> + *
> + * @return
> + * 0 on success, otherwise negative error code.
> + */
> +int
> +mlx5_flex_get_tunnel_mode(const struct rte_flow_item *item,
> + enum rte_flow_item_flex_tunnel_mode
> *tunnel_mode) {
> + if (item && item->spec && tunnel_mode) {
> + const struct rte_flow_item_flex *spec = item->spec;
> + struct mlx5_flex_item *flex = (struct mlx5_flex_item *)spec-
> >handle;
> +
> + if (flex) {
> + *tunnel_mode = flex->tunnel_mode;
> + return 0;
> + }
> + }
> + return -EINVAL;
> +}
> +
> /**
> * Translate item pattern into matcher fields according to translation
> * array.
> --
> 2.34.1
Acked-by: Dariusz Sosnowski <dsosnow...@nvidia.com>
Resending the Ack for each patch separately, because patchwork assigned my Ack
for the series to v1, not v2.
Best regards,
Dariusz Sosnowski