[dpdk-dev] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
Slava Ovsiienko
viacheslavo at mellanox.com
Mon Jan 20 14:08:24 CET 2020
> -----Original Message-----
> From: Suanming Mou <suanmingm at mellanox.com>
> Sent: Wednesday, January 8, 2020 12:41
> To: Matan Azrad <matan at mellanox.com>; Shahaf Shuler
> <shahafs at mellanox.com>; Slava Ovsiienko <viacheslavo at mellanox.com>
> Cc: dev at dpdk.org; xiangxia.m.yue at gmail.com; Raslan Darawsheh
> <rasland at mellanox.com>; stable at dpdk.org
> Subject: [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
>
> The meter suffix flow item pointer restore is not correct to decrease a fixed
> value. The incorrect operation will cause incorrect match to the meter suffix
> flow, the flow create will fail once the magic number in the wrong offset
> memory start with RTE_FLOW_ITEM_TYPE_END.
> The pointer should decrease the real offset it increases.
>
> Set the decrease value to the real offset the pointer increases to fix the issue.
>
> Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
> Cc: stable at dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm at mellanox.com>
> Reported-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
> ---
>
> v2: commit message adjust.
>
> ---
> drivers/net/mlx5/mlx5_flow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index cb9d265..52ffcb2 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> sfx_items++;
> }
> sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
> - sfx_items -= METER_SUFFIX_ITEM;
> + sfx_items -= sfx_port_id_item ? 2 : 1;
> /* Setting the sfx group atrr. */
> sfx_attr.group = sfx_attr.transfer ?
> (MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :
> --
> 1.8.3.1
More information about the dev
mailing list