From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DDA14A0350 for ; Mon, 21 Feb 2022 16:40:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D57224068C; Mon, 21 Feb 2022 16:40:35 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 81F3F4068C for ; Mon, 21 Feb 2022 16:40:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645458034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VI7VdNXTR0ZgWcnAr0Zg8W9Mrdoexy4/1EU5b30aysM=; b=U4ooQoP1k1dor1ROUMMwfgxvbIXCVaXLVr6YA8fx3AELilzkOfZVbA1w1OskINP5AzmdRP kXFW5mYuXixcDF+6zUS71vSb+uw22HmgyxB06v3VAJXyqZDKErbyl0MRgc7BHg2H95sD7l wZtSYTo6zV18F2zjIT+QEdNpe8Zs3y4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-qQGcllLmNuuy_r6ocyZaLQ-1; Mon, 21 Feb 2022 10:40:30 -0500 X-MC-Unique: qQGcllLmNuuy_r6ocyZaLQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30407100C662; Mon, 21 Feb 2022 15:40:29 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E77A67E133; Mon, 21 Feb 2022 15:40:27 +0000 (UTC) From: Kevin Traynor To: Dmitry Kozlyuk Cc: Wang Yunjian , Viacheslav Ovsiienko , dpdk stable Subject: patch 'common/mlx5: fix MR lookup for non-contiguous mempool' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:35:02 +0000 Message-Id: <20220221153625.152324-113-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Signed-off-by: Dmitry Kozlyuk Reviewed-by: Viacheslav Ovsiienko --- 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@dpdk.org