patch 'net/mlx5: fix committed bucket size' has been queued to stable release 19.11.12

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Fri Feb 25 18:15:48 CET 2022


Hi,

FYI, your patch has been queued to stable release 19.11.12

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8b3ab4586f0be206a8483d705f05e01bc9c3125b

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 8b3ab4586f0be206a8483d705f05e01bc9c3125b Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev at nvidia.com>
Date: Mon, 7 Feb 2022 15:28:40 +0200
Subject: [PATCH] net/mlx5: fix committed bucket size

[ upstream commit 21fdeab422e0edabc6b738f7a0c56dec7e9c374e ]

Committed Bucket Size calculation tries to fit into 8-bit wide
mantissa field by setting 256 as a maximum value for it.
To compensate for this increase in the mantissa value the exponent
value has to be reduced by 8. But it gives a negative exponent
value for CBS less than 128. And negative exponent value is not
supported by the NIC. Adjust CSB calculation only for values
bigger than 128 to allow both small and big bucket sizes.

Fixes: 3bd26b23cefc ("net/mlx5: support meter profile operations")

Signed-off-by: Alexander Kozyrev <akozyrev at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_meter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index 62e3a35902..e51a85b477 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -213,8 +213,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)
 	}
 	/* xbs = xbs_mantissa * 2^xbs_exponent */
 	_man = frexp(xbs, &_exp);
-	_man = _man * pow(2, MLX5_MAN_WIDTH);
-	_exp = _exp - MLX5_MAN_WIDTH;
+	if (_exp >= MLX5_MAN_WIDTH) {
+		_man = _man * pow(2, MLX5_MAN_WIDTH);
+		_exp = _exp - MLX5_MAN_WIDTH;
+	}
 	*man = (uint8_t)ceil(_man);
 	*exp = _exp;
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.351199502 +0100
+++ 0055-net-mlx5-fix-committed-bucket-size.patch	2022-02-25 16:58:44.300990467 +0100
@@ -1 +1 @@
-From 21fdeab422e0edabc6b738f7a0c56dec7e9c374e Mon Sep 17 00:00:00 2001
+From 8b3ab4586f0be206a8483d705f05e01bc9c3125b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 21fdeab422e0edabc6b738f7a0c56dec7e9c374e ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index 0dc7fbfb32..d0f8bcd100 100644
+index 62e3a35902..e51a85b477 100644
@@ -27 +28 @@
-@@ -295,8 +295,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)
+@@ -213,8 +213,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)


More information about the stable mailing list