From: Suanming Mou Date: Wed, 8 Jan 2020 10:41:09 +0000 (+0200) Subject: net/mlx5: fix meter suffix flow X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=64927f72a72fad39898b084e0cf66cc97b40959f;p=dpdk.git 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 --- 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) :