From 64927f72a72fad39898b084e0cf66cc97b40959f Mon Sep 17 00:00:00 2001 From: Suanming Mou Date: Wed, 8 Jan 2020 12:41:09 +0200 Subject: [PATCH] net/mlx5: fix meter suffix flow 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@dpdk.org Reported-by: Tonghao Zhang Signed-off-by: Suanming Mou Acked-by: Viacheslav Ovsiienko --- 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 bb1f1f16a1..970123bf11 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -4042,7 +4042,7 @@ flow_create_split_meter(struct rte_eth_dev *dev, 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) : -- 2.20.1