patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1] net/mlx5: fix meter flow id
@ 2021-05-12 10:20 Shun Hao
  2021-05-12 11:52 ` Matan Azrad
  0 siblings, 1 reply; 3+ messages in thread
From: Shun Hao @ 2021-05-12 10:20 UTC (permalink / raw)
  To: shunh, orika, viacheslavo, matan, shahafs
  Cc: dev, thomas, rasland, roniba, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 32634c9af7..edfac0d99f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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);
-- 
2.20.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH v1] net/mlx5: fix meter flow id
  2021-05-12 10:20 [dpdk-stable] [PATCH v1] net/mlx5: fix meter flow id Shun Hao
@ 2021-05-12 11:52 ` Matan Azrad
  2021-05-12 12:50   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Matan Azrad @ 2021-05-12 11:52 UTC (permalink / raw)
  To: Shun Hao, Ori Kam, Slava Ovsiienko, Shahaf Shuler
  Cc: dev, NBU-Contact-Thomas Monjalon, Raslan Darawsheh,
	Roni Bar Yanai, stable



From: Shun Hao
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v1] net/mlx5: fix meter flow id
  2021-05-12 11:52 ` Matan Azrad
@ 2021-05-12 12:50   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-05-12 12:50 UTC (permalink / raw)
  To: Shun Hao
  Cc: Ori Kam, Slava Ovsiienko, dev, Raslan Darawsheh, Roni Bar Yanai,
	stable, Matan Azrad

> > 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")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Shun Hao <shunh@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Applied in next-net-mlx, thanks.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-17  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 10:20 [dpdk-stable] [PATCH v1] net/mlx5: fix meter flow id Shun Hao
2021-05-12 11:52 ` Matan Azrad
2021-05-12 12:50   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).