patch 'common/mlx5: fix MR lookup for non-contiguous mempool' has been queued to stable release 21.11.1
Kevin Traynor
ktraynor at redhat.com
Mon Feb 21 16:35:02 CET 2022
Hi,
FYI, your patch has been queued to stable release 21.11.1
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/26/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/d157628041950df5ed147c75272c9362c05e2fe9
Thanks.
Kevin
---
>From d157628041950df5ed147c75272c9362c05e2fe9 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Date: Fri, 14 Jan 2022 12:52:17 +0200
Subject: [PATCH] common/mlx5: fix MR lookup for non-contiguous mempool
[ upstream commit 2eb92b0fbbabcb1fb49d2006de7682cca80ebea7 ]
Memory region (MR) lookup by address inside mempool MRs
was not accounting for the upper bound of an MR.
For mempools covered by multiple MRs this could return
a wrong MR LKey, typically resulting in an unrecoverable
TxQ failure:
mlx5_net: Cannot change Tx QP state to INIT Invalid argument
Corresponding message from /var/log/dpdk_mlx5_port_X_txq_Y_index_Z*:
Unexpected CQE error syndrome 0x04 CQN = 128 SQN = 4848
wqe_counter = 0 wq_ci = 9 cq_ci = 122
This is likely to happen with --legacy-mem and IOVA-as-PA,
because EAL intentionally maps pages at non-adjacent PA
to non-adjacent VA in this mode, and MLX5 PMD works with VA.
Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")
Reported-by: Wang Yunjian <wangyunjian at huawei.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/common/mlx5/mlx5_common_mr.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 1537b5d428..5f7e4f6734 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -1835,10 +1835,11 @@ mlx5_mempool_reg_addr2mr(struct mlx5_mempool_reg *mpr, uintptr_t addr,
for (i = 0; i < mpr->mrs_n; i++) {
const struct mlx5_pmd_mr *mr = &mpr->mrs[i].pmd_mr;
- uintptr_t mr_addr = (uintptr_t)mr->addr;
+ uintptr_t mr_start = (uintptr_t)mr->addr;
+ uintptr_t mr_end = mr_start + mr->len;
- if (mr_addr <= addr) {
+ if (mr_start <= addr && addr < mr_end) {
lkey = rte_cpu_to_be_32(mr->lkey);
- entry->start = mr_addr;
- entry->end = mr_addr + mr->len;
+ entry->start = mr_start;
+ entry->end = mr_end;
entry->lkey = lkey;
break;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2022-02-21 15:22:47.048057132 +0000
+++ 0113-common-mlx5-fix-MR-lookup-for-non-contiguous-mempool.patch 2022-02-21 15:22:44.218704412 +0000
@@ -1 +1 @@
-From 2eb92b0fbbabcb1fb49d2006de7682cca80ebea7 Mon Sep 17 00:00:00 2001
+From d157628041950df5ed147c75272c9362c05e2fe9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2eb92b0fbbabcb1fb49d2006de7682cca80ebea7 ]
+
@@ -24 +25,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list