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 DCDA5A0505 for ; Thu, 31 Mar 2022 16:39:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDE2542900; Thu, 31 Mar 2022 16:39:08 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67]) by mails.dpdk.org (Postfix) with ESMTP id 5D7424014F; Thu, 31 Mar 2022 16:39:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jPOXJH+26MpzrfScJAsEgNQZZUa4QjExSWJhWpJyWHeMvKMzokq3DIaEE5qF98d9dNrnxVeBfjFDuGTUH3MgbomURRWUD/xOuElLoEecimGDRpScY8V1h2uvc1LzXbWJinc05DssOADuLXpMeSHpLYFocz/JH9RW323nSvh9FJwyawkR3+6A4qB5dqfv1S4O9ZPkTrmutMtw8yMXqh2Zy0BrsOEwO+4SyTVwDeC3LGKTMFJMzuhyQHqETlMdnNGCvYRBKAwnXVjeI/+fb46cVTtOgoTJ7KqNtvEiD/BI+gxrme9baN9kF60gRIKvweHLfAvx9ZLLmiXYZium0R4CcA== 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=9I7ulH6WP9SVNtYSAsJ7VVtLFmixRt3MZlmKITJI4CI=; b=FBsA+nqh4dLPwwE5BxYPg8V/BhFzi2IhcV2IPjRioZTc/NXWGET6TphuXwpzNxhVE6qdzSDHXduyXXTwR7SQH7kupa6YpsyfN6lA/Zf/fNKfgvmg1WJK/Jd9tyT1J3qeMPElHwrfrjNyXK0fnuvNYrbC6kVEawPXcI/WRnDVo9BL0XeuRo+ZD9d0rH4PqpibsY5/Kqei4DUe+wIhNUGWC/rfOZlzb08UFF/60LBXcXp3hDRQCDx5CJneNoBE+C5wstT7RtkXVsEfy5TeW2JFUkoCob9krHBqOPii8h6d+hlIQ0tblv47Bm3t0JoOU9g+R9JVXo+A+pK03xdJJ+Lxqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=9I7ulH6WP9SVNtYSAsJ7VVtLFmixRt3MZlmKITJI4CI=; b=cC6KvsDpI8udGLiIoAxmK9OpLqDjWdIShyLGqMQLxvVQVDzzHQNmhfwuGMnrRsCs+aQqYRTtvhLRGMBp+YPEv5upHGkh61VgAkLWxf5JuTTbHyvUQpt+aLnftFZc9X8P3qWuDqZPO5on5jCh+2CHoRBafoBEmpkczkb0vDdrPN7tSYXPi6kGoImxe/eOMEF+rBA9pha8CnFcdThY2xlQzRT/eiyTRLLr+J6/XAEwcUfVWJA6sAy3bmWap4VpBXn+YEqTAHqKWZMP6ki4hPOYBmbwu+Sd58vK0vLFNKY7A1JyaPjZOYf+xIVc47wfKOaTNZVKUMNhaWB1CDdAXhF8IA== Received: from BN9PR03CA0044.namprd03.prod.outlook.com (2603:10b6:408:fb::19) by BN8PR12MB4770.namprd12.prod.outlook.com (2603:10b6:408:a1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.18; Thu, 31 Mar 2022 14:39:04 +0000 Received: from BN8NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::b5) by BN9PR03CA0044.outlook.office365.com (2603:10b6:408:fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.23 via Frontend Transport; Thu, 31 Mar 2022 14:39:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT062.mail.protection.outlook.com (10.13.177.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5123.19 via Frontend Transport; Thu, 31 Mar 2022 14:39:04 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 31 Mar 2022 14:39:03 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 31 Mar 2022 07:39:02 -0700 Received: from nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Thu, 31 Mar 2022 07:39:01 -0700 From: Dmitry Kozlyuk To: CC: , Viacheslav Ovsiienko , "Matan Azrad" Subject: [PATCH] net/mlx5: fix TxQ failure when inlining is impossible Date: Thu, 31 Mar 2022 17:38:41 +0300 Message-ID: <20220331143841.3345059-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97fae6e9-72db-49f6-064a-08da13243497 X-MS-TrafficTypeDiagnostic: BN8PR12MB4770:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bBrEhN8h+w3gbbigsf81/Ino5lYzoBggZdryUgTKDI4xKWh+oKDFx4qGRqpSKiqV8JsU/z7MgpRaVvyoTriiou7nhzVKelmAA3SFXTBvQkwLHpaAdkI36BeD/D7fI3kfi1VF5jZyEzCe8nHCPue0to/6c9SzNkWwz4vERkQ7NDA9jEYCDRGICo4z/wozN8hVh4oGh+fb56pNHTPP2+6VDJOrG7A6TnkljjaeCZoF05M1e+ATYs6emyRKDsli5knl9AUgE1uzxBlvdexMFrSyXN4dQXeK4LVY25W2muB1WSCZquKy8DWDCuJnhL92CM44qXOhzp57Bncdza4poCMehcl2rl2mZ3+yyOibh2IgVkY55cZ0BsftPpTnwPKbELKsRvYAD0szCVmhmMS7Kr/B1rCqkweIWlN5hGkh2KuTUn3ijnFHA0MC14+h+bUn1y57XrnYEirJjjakb6P/6Kl/s9HHinqkcgejPPRSUNRw1Qkx0y5h9sRyriELbDIZEfGXFaHyHYa3Ff33W44GzkxqHHDhSlj9FYBniaWqqPl302WkldWFxJ1Ehwotr6U8ibeEG7gD2MxjGKR46SDTursKx1goTJGhYMgj3QfEsHhpDXYUggYc5vBmXGtC49N9mvbZ4fEqtLn/jY6bkon76V/zDSOCoB5ZSdHJT4G2N44PaQOtbCrGcWjBTrVmwB7nbCYH+AxIuqwJRGuL4s/7lHfYcg== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(70586007)(8676002)(356005)(82310400004)(6286002)(4326008)(6666004)(5660300002)(81166007)(36860700001)(2616005)(8936002)(508600001)(55016003)(86362001)(107886003)(426003)(316002)(336012)(40460700003)(26005)(1076003)(186003)(54906003)(7696005)(83380400001)(36756003)(2906002)(70206006)(450100002)(6916009)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 14:39:04.6534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97fae6e9-72db-49f6-064a-08da13243497 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB4770 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 When txq_inline_max is too large and an mbuf is multi-segment it may be impossible to inline data and build a valid WQE, because WQE length would be larger then HW can represent. It is impossible to detect misconfiguration at startup, because the condition depends on the mbuf composition. The check on the data path to prevent the error treated the length limit as expressed in 64B units, while the calculated length and limit are in 16B units. Fix the condition to avoid subsequent TxQ failure and recovery. Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_tx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h index 89dac0c65a..dfa04612ff 100644 --- a/drivers/net/mlx5/mlx5_tx.h +++ b/drivers/net/mlx5/mlx5_tx.h @@ -2070,7 +2070,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, if (unlikely(loc->wqe_free < ((ds + 3) / 4))) return MLX5_TXCMP_CODE_EXIT; /* Check for maximal WQE size. */ - if (unlikely((MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE) < ((ds + 3) / 4))) + if (unlikely((MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE) < ds)) return MLX5_TXCMP_CODE_ERROR; #ifdef MLX5_PMD_SOFT_COUNTERS /* Update sent data bytes/packets counters. */ -- 2.25.1