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 5C7C245AA2; Thu, 3 Oct 2024 22:28:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0927402B1; Thu, 3 Oct 2024 22:28:58 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2048.outbound.protection.outlook.com [40.107.212.48]) by mails.dpdk.org (Postfix) with ESMTP id 4148E40268; Thu, 3 Oct 2024 22:28:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IgBmwxzzMpQPqEnCattpjILE4voj4CKTLdtjiTEIJMolu06JvcWZDrqAwySQ2PLLf8qsbVnTato8NbnhXjegRFNv0GQFGgJEjQVuaoMOsMA2pccgPltFZIN6FELA/a0vdSczKFpBoQovHf5bFAXcUPy8Lp2gWG8HjwGon1j7/FM18t3x/KzpwiudcDaE4Gvsu+0liRJJXIEOFR0WcU639y8smtp5+Iv1qytNAGwxgP/6V6h/7QzsAGYS7LjTiYcIhwQZKnOTZv/fCT43gX0vaHTRQSK/rhuOXGgNIDxzXQnsbIYJcGg/ce0VH550Qpxh5dIKfLmu4JGDBEBPtXFINg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aoUBV/i3b79R2Ql8ckFll9rixhhEUijV7MtwLeERek0=; b=hLlvjBDPOAO4SAlT15GL8BvO+6GFHUMhUB1VyF74LRg7elQJAnE03w1QT8Me20Lfy2AdMbwbcWOD+P9nZ2hx3B/MWYZCFfpvJldE9I5m1G+boRnj7vFdpXfUhcnsSJEenoo5gDE9M/bNtsN7Xpr8LLrJI/BAwiS/fDUIr2QL+WNLSTA3W75HfE6OuGKRWA8uFsGqND7A2HdaMmpQTy3qUjsqZt3xBCpJXpsGgxIz8gDt9XNh1WUdWjruvCl6zZIvRok+c7Y5ckjwCptPtimycRDh5enY/kVjP+FkcChSWkMq1wvLwUzxk6kneEvKbRAyhaV73JMVbRNKWDXpooc3UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aoUBV/i3b79R2Ql8ckFll9rixhhEUijV7MtwLeERek0=; b=E3q7ZNb7oPLWXeyLTpeiXCPfGgjDd+2OHZMqIx9yhoZJY+3L39yD8Ragw5tlec+EBzuwipZypp0AjQu2ekYznBK8YqtW8/J7Yr84HxFzNYQjyEEHUjMc3hEF7UumaUV6OLElxiPC9Az2vjTK9Db0TQOlKpWM81gFi+DcXbyHoaG3Iy9hiZkl6EK6PocsB4p+GnyCVYlZ6lCo1l2g0A+bXOOvjo1LDFzjXzspA7SuKMktD/i3jcS7Hg1MsudNR7ACH1yL+o3lSu0+xtzf4zjn0ZixnZ1+VXm/UdGub4l5nlPR3w9LEdNeJdFjSZorhZKN2r7m6w7grupjMXiTLf9g5w== Received: from PH7P222CA0007.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::32) by IA1PR12MB6649.namprd12.prod.outlook.com (2603:10b6:208:3a2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Thu, 3 Oct 2024 20:28:52 +0000 Received: from SN1PEPF00036F3E.namprd05.prod.outlook.com (2603:10b6:510:33a:cafe::16) by PH7P222CA0007.outlook.office365.com (2603:10b6:510:33a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.16 via Frontend Transport; Thu, 3 Oct 2024 20:28:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF00036F3E.mail.protection.outlook.com (10.167.248.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.11 via Frontend Transport; Thu, 3 Oct 2024 20:28:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Oct 2024 13:28:32 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Oct 2024 13:28:30 -0700 From: Alexander Kozyrev To: CC: , , , , Subject: [PATCH v2] drivers: ignore non-critical syndromes for Tx queues Date: Thu, 3 Oct 2024 23:28:15 +0300 Message-ID: <20241003202815.870524-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20230502185047.3250224-1-akozyrev@nvidia.com> References: <20230502185047.3250224-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3E:EE_|IA1PR12MB6649:EE_ X-MS-Office365-Filtering-Correlation-Id: d84c739c-1dce-4454-d269-08dce3e9febf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?o1zwjVypAS7WKJFbw/hbx4zUPTF9YlQvhoZHAtzI+wZOnigsssgB8dsSYzec?= =?us-ascii?Q?bUGROBHgvUPpXwkgzxpy5WI/FcgMxU7zvXxuPenG0t/4Shi/7NpVOEwCp3C9?= =?us-ascii?Q?S4/wxqh+rasz9bUSHY14i7/MGxgr7fnxI8bJ8QoXBzTLGxNsh9pQ1ZcyunKp?= =?us-ascii?Q?Rwca1EeFH9uHNAgwHxU1xrMWU4ejLX+QdmVKpvpJ9a6tdwaPqdQAMim+aCWW?= =?us-ascii?Q?1nOIQSHXQX8mpOGDjWhdIaOfIvPYkfKK2yc5H5LRsMvSQ6IbdeeYmXf+XVyM?= =?us-ascii?Q?bffQIEOZGzZoxEH9DIVPvXgTHJ8jNNt/I4jk3jH6lw7DkdeNvcBdWhbmj52e?= =?us-ascii?Q?bQ2k32kGKRuSgDwXrxp6JgUxO6If0lm1rHnqLT/eFqGRTIG8Vc63Hj0/Lx7f?= =?us-ascii?Q?9bJdbabNenQnfmdzOKgrvRSOv2LAto5YQzNEEVM3zemUwDxjEqAw/bd9PWdQ?= =?us-ascii?Q?iupfUKAeP4Wonv0EuBSTNWK8coSaDJy3rV226NR/oBkchnGO6+4dR0Jt1eNx?= =?us-ascii?Q?HuCQoMC6osnY6DkAJSzc0eYsXnk4UQUyzbTNoniEXMi6XHngLxzsNWtwdAFZ?= =?us-ascii?Q?HUB3UdaD8fbCkz0BHiqAlyEQmlfZdYm4o6H/Y8CrzDWBbq4NeGYJ64Mdvstn?= =?us-ascii?Q?8KKzQUxwUNVX7fkBom1740LBWy3fa14SaFUfIAKm/DqoFLfTIs7mHzOiVt0m?= =?us-ascii?Q?9ip1ikvwoK1Ws5BZWYoxMhkt0V7myvWVuuaM3sMnMyxxig9hCJWHbkcsBZIe?= =?us-ascii?Q?5Zo4/arcwnYHaEJCe3BWSPtXExMOwngwP1ZXH+eYd6/LAS513ChWpvbOxc/m?= =?us-ascii?Q?JNIf+d5PBiP1yC88WaIOrAGajAjHWTjhChFZZght5TEwpPUW7WJvCle+bUPd?= =?us-ascii?Q?iY6YO1CB+3CCY5kk/naxrQCRWvu8qYSyg+CkvTZ13NPqoCV+9YUvTEUbPZt3?= =?us-ascii?Q?wXq3YlbDSTqlIGpAWSWe8zZ0D5161kgNEQl2c/13sMOW1qZmcrMCxZBTacc7?= =?us-ascii?Q?sldo6Zrn2C8obG+ud02Q/OQ3Gzo3Kc/98tk3ALGwGE9EJhvfPNBmVqNpJhBM?= =?us-ascii?Q?RIf49e7EMJbe4m/AU6SWkiDYkd9lzyTHzxc6kVGmA3qVIkDRM0S1hy/2kkev?= =?us-ascii?Q?1YgtqrzL9dd21f2IT/VLCsDjmY67V+V0JCLjX2BskGAs5IGd/Y3daWBq/vHQ?= =?us-ascii?Q?jcO9N7MKYAytC5i/2PgIRaP98xLAX6MhckwdiTjRu8KDbyQMgg8FVSr3V4er?= =?us-ascii?Q?jaIULk4emoaIe9Y07uuYnbF1o+WqcBvKlTiWcc+KvYRzhJwi1/r+ZbwqMUTE?= =?us-ascii?Q?jeUJsvf5ee5fwVR5ql5V+ScTM42z/7PVoxUMiYZoT8CiraIdTIAV2OQAfUl3?= =?us-ascii?Q?dLIvghswFkQXMVn+TIzEhbizcW5G?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2024 20:28:51.9230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d84c739c-1dce-4454-d269-08dce3e9febf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6649 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Only 3 syndromes are considered critical and warrant a queue restart. All other syndromes can be safely ignored. We ignore them for Rx queues. Skip non-critical error CQEs for Tx queues as well. Fixes: 957e45fb7b ("net/mlx5: handle Tx completion with error") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev --- drivers/common/mlx5/mlx5_prm.h | 17 +++++++++++++++++ drivers/net/mlx5/mlx5_rx.c | 4 +--- drivers/net/mlx5/mlx5_tx.c | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 210158350d..e4034699d8 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -5614,4 +5614,21 @@ mlx5_ts_format_conv(uint32_t ts_format) MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; } +/** + * Check if an error CQE syndrome is critical. + * + * @param syndrome + * Error CQE syndrome to check. + * + * @return + * Positive value if critical, 0 otherwise. + */ +static inline uint32_t +mlx5_critical_syndrome(uint8_t syndrome) +{ + return (syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR || + syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR || + syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR); +} + #endif /* RTE_PMD_MLX5_PRM_H_ */ diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index 5e58eb8bc9..a562daa7c3 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -479,9 +479,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, for (i = 0; i < (int)err_n; i++) { u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask]; if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR) { - if (u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR || - u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR || - u.err_cqe->syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR) + if (mlx5_critical_syndrome(u.err_cqe->syndrome)) critical_syndrome = true; break; } diff --git a/drivers/net/mlx5/mlx5_tx.c b/drivers/net/mlx5/mlx5_tx.c index 2f48bbc82e..2c53feeb9c 100644 --- a/drivers/net/mlx5/mlx5_tx.c +++ b/drivers/net/mlx5/mlx5_tx.c @@ -85,7 +85,7 @@ static int mlx5_tx_error_cqe_handle(struct mlx5_txq_data *__rte_restrict txq, volatile struct mlx5_error_cqe *err_cqe) { - if (err_cqe->syndrome != MLX5_CQE_SYNDROME_WR_FLUSH_ERR) { + if (mlx5_critical_syndrome(err_cqe->syndrome)) { const uint16_t wqe_m = ((1 << txq->wqe_n) - 1); struct mlx5_txq_ctrl *txq_ctrl = container_of(txq, struct mlx5_txq_ctrl, txq); @@ -217,7 +217,7 @@ mlx5_tx_handle_completion(struct mlx5_txq_data *__rte_restrict txq, } /* * We are going to fetch all entries with - * MLX5_CQE_SYNDROME_WR_FLUSH_ERR status. + * non-critical error syndromes. * The send queue is supposed to be empty. */ ring_doorbell = true; -- 2.18.2