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 C76E741E34 for ; Thu, 9 Mar 2023 03:32:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C08F341151; Thu, 9 Mar 2023 03:32:59 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 1EA0C40A7E; Thu, 9 Mar 2023 03:32:57 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B1CFFEC; Wed, 8 Mar 2023 18:33:40 -0800 (PST) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.14.10]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 79D283F5A1; Wed, 8 Mar 2023 18:32:56 -0800 (PST) From: Honnappa Nagarahalli To: matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, nd@arm.com, matan@mellanox.com, stable@dpdk.org Subject: [PATCH v3] net/mlx5: use just sufficient barrier for ARM platforms Date: Wed, 8 Mar 2023 20:32:47 -0600 Message-Id: <20230309023247.1241515-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220830200038.1694160-1-honnappa.nagarahalli@arm.com> References: <20220830200038.1694160-1-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 cqe->op_own indicates if the CQE is owned by the NIC. The rest of the fields in CQE should be read only after op_own is read. On Arm platforms using "dmb ishld" is sufficient to enforce this. Fixes: 88c0733535d6 ("net/mlx5: extend Rx completion with error handling") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- drivers/common/mlx5/mlx5_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index f8d07d6c6b..f4ddaf9f11 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -203,7 +203,11 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n, if (unlikely((op_owner != (!!(idx))) || (op_code == MLX5_CQE_INVALID))) return MLX5_CQE_STATUS_HW_OWN; - rte_io_rmb(); + /* Prevent speculative reading of other fields in CQE until + * CQE is valid. + */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); + if (unlikely(op_code == MLX5_CQE_RESP_ERR || op_code == MLX5_CQE_REQ_ERR)) return MLX5_CQE_STATUS_ERR; -- 2.25.1