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 342EE42A3E; Tue, 2 May 2023 20:51:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 239C340EE7; Tue, 2 May 2023 20:51:17 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2044.outbound.protection.outlook.com [40.107.100.44]) by mails.dpdk.org (Postfix) with ESMTP id 83C0640ED8; Tue, 2 May 2023 20:51:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IxQmB3HflIhNBXFvKOtJk3lC1vp0i16nDGB8oZH8w9hY8gqeDDcnGn3I+PqE8WISrk04Rdj1YQhdfPs6oK1iReL0ct9V+dVEbAdji75CH1fA6Ps1BwfTg4NoFUry28XDfK2Nj9BlqSiI+Q9k4gg1wwn3LnCDX7T9CLRLF+34ZUbGtwNTTAqOCC/p660qA9ZgOEZiqbqfxEw6KyXGC274v+k4VPo0cJiv6mUDx1S/cxk83BppHwNA9moY5FeqbYPazN3HPgGvJ+jF+eor71oD6eTSJ1OPrI5ZrpzEZiZelP+KKwT1Men0Red1Kwlg5BDIkSNuCuyslyioWFTezZxLBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LtetAMqITGQfFkbWqMf2KS9vDZb6BKdIaELTmbgVV7A=; b=OIvw3ruDv1XwruFAvzLjM9ZCtwaokqxfl3ZqeRXa1sux54ArDNldwTOgj3Kw2QtDpKvzw3Pgbc8TojPasDBW9+fBWoftE4Jg14KL6H9U+3KAThaPjE584ngo2ZN3pnAojWH6nbBCsjtXtU0+8O1BNMPuoSrSm8dqad8vCXWCqx5AEPbM4+emtCAUsgrtBTmvcEGYOVQCRt+xDxNANJAfQM7fFsTAxgmkvRDRcZY922zhA5+ZsQs/Iic3rvW2Qu6uqblVsV9nY4axYuipcJ5SoS/iM62PvAYpvf45njiogZLn2Rfb/wBwiEtjH8jB2i/GA5vWPhEH5dMw0nOnOdMcSA== 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 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=LtetAMqITGQfFkbWqMf2KS9vDZb6BKdIaELTmbgVV7A=; b=ZohAtUby7iyFRki7TzoR9mB+lxoBCDo9/Yct1zNLmUHS6eTlnT6z3pNiyh5yO1A/9vdMytHnOjXm3QiechGEaKFNj0M3MgKcBnu6A6m9P7yub8bYCcYxTqRBy1fiwhrpcEiuudOaW8GUcbdWnUss9LQOz4L5d2Q1rdTkgbkDcVnKmqhQqUZgJARIKVnM+ygyKky6kNQ5VK21CuWVzC3PDeJy/uibgWFOas/YFf3RifDDCFNVpIuejgLKnnpVqWxDjVHBO/pYVnlG8XzjNb9WGg29GsFwA0xXVfudPYPSCCjVm1O5WZ+/41isp65UW/Ar4e3yhEXka0mpJ4Fzm8I3Ww== Received: from DM6PR13CA0005.namprd13.prod.outlook.com (2603:10b6:5:bc::18) by DM4PR12MB7646.namprd12.prod.outlook.com (2603:10b6:8:106::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.30; Tue, 2 May 2023 18:51:14 +0000 Received: from DM6NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:5:bc:cafe::b6) by DM6PR13CA0005.outlook.office365.com (2603:10b6:5:bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.20 via Frontend Transport; Tue, 2 May 2023 18:51:14 +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 DM6NAM11FT017.mail.protection.outlook.com (10.13.172.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.20 via Frontend Transport; Tue, 2 May 2023 18:51:13 +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.986.5; Tue, 2 May 2023 11:51:02 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.37) 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.986.37; Tue, 2 May 2023 11:51:00 -0700 From: Alexander Kozyrev To: CC: , , , Subject: [PATCH] drivers: ignore non-critical syndromes for Tx queues Date: Tue, 2 May 2023 21:50:47 +0300 Message-ID: <20230502185047.3250224-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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: DM6NAM11FT017:EE_|DM4PR12MB7646:EE_ X-MS-Office365-Filtering-Correlation-Id: 64e90393-ec41-4600-5bec-08db4b3e343d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1qFla8mLr2GWjW52zHtxalzhbp3JwC89jQo42wgcp78uoX1J2ox8QP/aldkFIZJllytbbEyfIt61Xnt2gjaJAe15K+urzfJ8Z93CsqbQaRNiO/cteTT8I9njZY3ItytLfhwgIsb45ZJWdNSq4X/P3hY8pWew7RVR9qIN2Hs/lhTG69GbvtR3J0IPjkcbRkm7rrzW/Hfozyo3MvUP7cZaMfyHO72uEKeWn5pehJxq9PSVmmYQyFKnUWZmiqtbFh6fWF2yCSNwaPoeqvucOqVa+dfkM+2/TB8u0vVThyN0Wu8caTFyE6B0kzYgxp0h4N05CR19FSCKXgn55mrIABexevwdNa/ZWXD6aBdiOJuoVXQnFcq06HMoDjgJ2NPz6qgkV1LgpZBwkNnBQNoUogIuTYq1q18Ex4WYQR5HCgcvXZKQGMpDN9Ha1+GhL+dfRUyuNVFQelQdBJxh0ixrJcsLVEurRME5YMJ7utEEjVYwrrvBux4O0vq0CJej7BvTaH0NPBjDMANvNfKebxNLpF+qt6O3IpxVwhl9hKZqo4EP29Hv4PO/6EN5u0jBCY5dZon/TXkpuHHAvg8EyhKpUcmYqHzyAXzU2xjbn+2hTPBd0wFTrl/hgUOfjIUVfc4HuJ4wvYd2opthju0psTQa35kGAJCusQevCqKyHe5GbcSQpQ3aOAcNLJZoyOJoHugnOHdfMYPzKZENnxIMBUNeiu8Z7w== 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:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199021)(40470700004)(36840700001)(46966006)(16526019)(107886003)(26005)(1076003)(186003)(36860700001)(7636003)(86362001)(356005)(82740400003)(83380400001)(426003)(336012)(2616005)(47076005)(6666004)(36756003)(4326008)(70206006)(6916009)(70586007)(316002)(5660300002)(40460700003)(450100002)(40480700001)(2906002)(478600001)(82310400005)(41300700001)(54906003)(8676002)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2023 18:51:13.8143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64e90393-ec41-4600-5bec-08db4b3e343d 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: DM6NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7646 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 505ff3cc8e..93bcb5e4b7 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -5265,4 +5265,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 69fd173239..72c6eeac42 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 8b1a0ca3d3..1e6766bd84 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