net/mlx5: fix meter flow id
PATCH 1/1 net/mlx5: fix meter flow id
When getting meter flow_id bits, there's an issue that not handling correctly if flow_id is 0.
This fix this issue that when flow_id is 0, treat it as 1 bit.
Fixes 83306d6c46 ("net/mlx5: fix meter statistics")
Signed-off-by Shun Hao <[email protected]>
--- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_flow.c +2 -2
@@ -4794,8 +4794,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL , "Failed to allocate meter flow id."); flow_id = tag_id -1 ; - flow_id_bits =MLX5_REG_BITS -__builtin_clz (flow_id); - flow_id_bits = flow_id_bits ? flow_id_bits :1 ; + flow_id_bits = (!flow_id) ?1 : + (MLX5_REG_BITS -__builtin_clz (flow_id));if ((flow_id_bits + priv->sh->mtrmng->max_mtr_bits) > mtr_reg_bits) {mlx5_ipool_free (fm->flow_ipool, tag_id);
Signature · 1 line
2.20.0
From: Shun Hao
Quoted 9 lines
When getting meter
flow_idbits, there's an issue that not handling correctly ifflow_idis 0.This fix this issue that when
flow_idis 0, treat it as 1 bit.Fixes 83306d6c46 ("net/mlx5: fix meter statistics")Signed-off-by Shun Hao <[email protected]>
Acked-by Matan Azrad <[email protected]>
Thomas Monjalon
AppliedQuoted 10 lines
Quoted 9 lines
When getting meter
flow_idbits, there's an issue that not handling correctly ifflow_idis 0.This fix this issue that when
flow_idis 0, treat it as 1 bit.Fixes 83306d6c46 ("net/mlx5: fix meter statistics")Signed-off-by Shun Hao <[email protected]>Acked-by Matan Azrad <[email protected]>
Applied in next-net-mlx, thanks.