patch 'common/mlx5: fix memory region range calculation' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Tue May 10 14:29:48 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/15/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/72691359faa37e4ae67027bee6ea7231ac8dfac9

Thanks.

Kevin

---
>From 72691359faa37e4ae67027bee6ea7231ac8dfac9 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Date: Thu, 31 Mar 2022 17:33:16 +0300
Subject: [PATCH] common/mlx5: fix memory region range calculation

[ upstream commit 8113251862a0813e171d76a6a56b7f93987690ce ]

MR end for a mempool chunk may be calculated incorrectly.
For example, for chunk with addr=1.5M and len=1M with 2M page size
the range would be [0, 2M), while the proper result is [0, 4M).
Fix the calculation.

Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/common/mlx5/mlx5_common_mr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 5f7e4f6734..4a5936bcdf 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -1291,9 +1291,10 @@ mlx5_range_from_mempool_chunk(struct rte_mempool *mp, void *opaque,
 {
 	struct mlx5_range *ranges = opaque, *range = &ranges[idx];
+	uintptr_t start = (uintptr_t)memhdr->addr;
 	uint64_t page_size = rte_mem_page_size();
 
 	RTE_SET_USED(mp);
-	range->start = RTE_ALIGN_FLOOR((uintptr_t)memhdr->addr, page_size);
-	range->end = RTE_ALIGN_CEIL(range->start + memhdr->len, page_size);
+	range->start = RTE_ALIGN_FLOOR(start, page_size);
+	range->end = RTE_ALIGN_CEIL(start + memhdr->len, page_size);
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-05-10 13:24:21.862450102 +0100
+++ 0011-common-mlx5-fix-memory-region-range-calculation.patch	2022-05-10 13:24:21.573646321 +0100
@@ -1 +1 @@
-From 8113251862a0813e171d76a6a56b7f93987690ce Mon Sep 17 00:00:00 2001
+From 72691359faa37e4ae67027bee6ea7231ac8dfac9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8113251862a0813e171d76a6a56b7f93987690ce ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index fa27bd98de..06e4c8f187 100644
+index 5f7e4f6734..4a5936bcdf 100644
@@ -24 +25 @@
-@@ -1290,9 +1290,10 @@ mlx5_range_from_mempool_chunk(struct rte_mempool *mp, void *opaque,
+@@ -1291,9 +1291,10 @@ mlx5_range_from_mempool_chunk(struct rte_mempool *mp, void *opaque,



More information about the stable mailing list