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 AEB86433D8 for ; Mon, 11 Dec 2023 11:21:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97F9D40ED2; Mon, 11 Dec 2023 11:21:05 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) by mails.dpdk.org (Postfix) with ESMTP id 45C2A40E0F for ; Mon, 11 Dec 2023 11:21:04 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F+CakHxBf016F4RWniM8uOFRsvmieimLfEchdyivewx2KMdlKdPHiU3J2eoSjsWOhYFtOZUtFq7Z62afp6A0GwGZ+bpJNbBSj/kQWwzFPErJke+C2cjiUs1LKGd18yqr3bjhEmfkHN8dbySZ9UfqrQUhOiw9GAmsFL57f5ALwFXOAkpMfVD5hTO8Hk9ZEqeZsjuIJC+2UoOVzrkYweT5D24USvE0shdduDD3HRLYRYk9QZIvCnU+8//vhPko/R8w27IWxBI2jRJOjqLam6BPcQNzM6JwGYhFZca8xit7LtQdRUhxrAYSeDKmZOWZU+MGv7OZd+NRu6mpD+75GRAm9g== 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=advw7y6nLTdQWVZwZETK9WtcCEM+DgZuqIvT+Hx4bc8=; b=cVUxlEU+OeQm90SnojJ/vRENGDAe/IQqfSrKlY1JqgT3dwwwYE+LYGtZ1kb58z5jClao1MVodK0U2NUl+d7CGvmhqty/h/FVFPU5KG6U6HUX/jWtH072R7pyVBVgx6lFVZAaetWnKE+9fcQweuWRhhWNyZTSYnfS7mVHw9CXocRR7vjGkdB5/6yrgFmEmrkZ3+83fAekQH91ItqP4Bopo/vPCayaRj+EOpa8O4vW3MqBz2AFDLRv64QNt1+T2mFuc5ROATlGzU7392la8BSUI4cxwO69mwsQ/f3ngskngdwR8uusTpFEuuiX6SZrVxoM0gQAe8WVaC8J2fp0MYR29w== 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=advw7y6nLTdQWVZwZETK9WtcCEM+DgZuqIvT+Hx4bc8=; b=kLZhm6EypS083C87vfDLBYNxvSmUcxhD/z58s3m3qvX9tAxnKR9lewxdIotzNZn3MNczgr8nszP55QZQzt+RddRXjJnJaKdqblT61pfB+E6qJKrOTpcLj0/sHe71Q3wGtCwVu43OlSL7TWuBsFSzTEpEFmkBwXPOtX4n1axToiF28kycDxtJEvHhTyajSKRwo9oNxBcdP6HjB540NPzKHTA/YjI1hnwYnymiAicCu6wzqa8mvoHUXmf8p6rUD5OCOhXArRdCyYtacBq0A5ekBQSsUMI7wMofXYWehAFzF8nIXuZeHPTXlab/vXPZGwEWpmp/5esKo3cnUzBJh/W1mw== Received: from SA9PR13CA0079.namprd13.prod.outlook.com (2603:10b6:806:23::24) by SJ0PR12MB7457.namprd12.prod.outlook.com (2603:10b6:a03:48d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:21:01 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:806:23:cafe::c3) by SA9PR13CA0079.outlook.office365.com (2603:10b6:806:23::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.21 via Frontend Transport; Mon, 11 Dec 2023 10:21:01 +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 SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:21:01 +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.41; Mon, 11 Dec 2023 02:20:47 -0800 Received: from nvidia.com (10.126.231.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.986.41; Mon, 11 Dec 2023 02:20:46 -0800 From: Xueming Li To: Dariusz Sosnowski CC: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix hairpin queue unbind' has been queued to stable release 22.11.4 Date: Mon, 11 Dec 2023 18:11:55 +0800 Message-ID: <20231211101226.2122-91-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211101226.2122-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> <20231211101226.2122-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529E:EE_|SJ0PR12MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: c539e721-5a4c-42e5-7041-08dbfa32dff3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qGpMx9dJgGCWvMycEQ2FXju4ksFI3RNe7p2aIavWsxvtLUpd4DhA+yrPOVjrMsxlgi1YXgJXVNFM1vciROXN4JFU5XTxkTOXyhxOdEEY3nvgrs481f7elv8WzY/mByMOHMuY9phq38sKMmbjTOHaIYTajpQGW4DMMZ8n1P1RoJjRHI32c+PxNGmFrMt3hza4ijYyCIZJyZWZpGOKqjW3F2hijz9vdnhpqkGlN4OR/lF1vQLa1oH+1K3IzXO8W4qcFuwg8QG/h7GPMYOIjThrOOx8qv9OhOUOBAyOxb23gUB5NRMvg5mhIkAOMdTVaZN3H1/Q7qc0nfPPf4x3xLw3bnoZkI9OGVb+O9a+D50aDYOPamDpaQWF8CG5ZnJ0hXtNCAM/8u9psDmjePMNaJCij61C4V4+uqQpXAS++BTYPKBPqHE0sh05NvOmz/Dk3nypMqCMzaOzLl7rKgfrdlCSSjZCNaBvDY62glnFma0zlWNWoUAecOvvwNRgSH/KBgWgk906Zdl4keYHCwe8uGTdabSIKhfS/HK8Q6GrpCJekqKybvw3wFBwC9rb8edZBBjGAWsPLguAfGelMQMT6W8YGNdV3pocT+DOwoG6Qln1r4+VOIEtS4/jonuLBoqJ6HptC1Aic51g2wptM6qfWoD3zEgmMMjhZbmk5HHSkgODtJtGQFCq6fbNgKIHW5sqFo56DbHgYOnac9HbjJK++/16qUOPDnMI8ooKJCrBUrAja4HjdS/Rh4RzYt/qNLVTimYvFe7MeagoGoZQ6yJYCoL3L5a40wJg5Q9fmpmPW4VQ3RM= 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:(13230031)(4636009)(136003)(396003)(39860400002)(376002)(346002)(230922051799003)(1800799012)(82310400011)(64100799003)(186009)(451199024)(40470700004)(36840700001)(46966006)(40480700001)(1076003)(426003)(336012)(6286002)(26005)(16526019)(2616005)(40460700003)(82740400003)(36756003)(55016003)(356005)(7636003)(86362001)(83380400001)(5660300002)(53546011)(7696005)(6666004)(36860700001)(47076005)(8936002)(8676002)(6862004)(70586007)(70206006)(966005)(54906003)(37006003)(6636002)(316002)(2906002)(4001150100001)(41300700001)(478600001)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:21:01.4232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c539e721-5a4c-42e5-7041-08dbfa32dff3 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: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7457 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 22.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/13/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=ab4675324505ddcdfecdafa1e336f2c83e1b80f8 Thanks. Xueming Li --- >From ab4675324505ddcdfecdafa1e336f2c83e1b80f8 Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Thu, 9 Nov 2023 20:01:09 +0200 Subject: [PATCH] net/mlx5: fix hairpin queue unbind Cc: Xueming Li [ upstream commit ab2439f80bdf94e2382efe941cf827da6710b5d7 ] Let's take an application with the following configuration: - It uses 2 ports. - Each port has 3 Rx queues and 3 Tx queues. - On each port, Rx queues have a following purposes: - Rx queue 0 - SW queue, - Rx queue 1 - hairpin queue, bound to Tx queue on the same port, - Rx queue 2 - hairpin queue, bound to Tx queue on another port. - On each port, Tx queues have a following purposes: - Tx queue 0 - SW queue, - Tx queue 1 - hairpin queue, bound to Rx queue on the same port, - Tx queue 2 - hairpin queue, bound to Rx queue on another port. - Application configured all of the hairpin queues for manual binding. After ports are configured and queues are set up, if the application does the following API call sequence: 1. rte_eth_dev_start(port_id=0) 2. rte_eth_hairpin_bind(tx_port=0, rx_port=0) 3. rte_eth_hairpin_bind(tx_port=0, rx_port=1) mlx5 PMD fails to modify SQ and logs this error: mlx5_common: mlx5_devx_cmds.c:2079: mlx5_devx_cmd_modify_sq(): Failed to modify SQ using DevX This error was caused by an incorrect unbind operation taken during error handling inside call (3). (3) fails, because port 1 (Rx side of the hairpin) was not started. As a result of this failure, PMD goes into error handling, where all previously bound hairpin queues are unbound. This is incorrect, since this error handling procedure in rte_eth_hairpin_bind() implementation assumes that all hairpin queues are bound to the same rx_port, which is not the case. The following sequence of function calls appears: - rte_eth_hairpin_queue_peer_unbind(rx_port=**1**, rx_queue=1, 0), - mlx5_hairpin_queue_peer_unbind(dev=**port 0**, tx_queue=1, 1). Which violates the hairpin queue destroy flow, by unbinding Tx queue 1 on port 0, before unbinding Rx queue 1 on port 1. This patch fixes that behavior, by filtering Tx queues on which error handling is done to only affect: - hairpin queues (it also reduces unnecessary debug log messages), - hairpin queues connected to the rx_port which is currently processed. Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode") Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_trigger.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 5bf637a0cd..80d2a60473 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -845,6 +845,11 @@ error: txq_ctrl = mlx5_txq_get(dev, i); if (txq_ctrl == NULL) continue; + if (!txq_ctrl->is_hairpin || + txq_ctrl->hairpin_conf.peers[0].port != rx_port) { + mlx5_txq_release(dev, i); + continue; + } rx_queue = txq_ctrl->hairpin_conf.peers[0].queue; rte_eth_hairpin_queue_peer_unbind(rx_port, rx_queue, 0); mlx5_hairpin_queue_peer_unbind(dev, i, 1); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-11 17:56:26.018245300 +0800 +++ 0090-net-mlx5-fix-hairpin-queue-unbind.patch 2023-12-11 17:56:23.187652300 +0800 @@ -1 +1 @@ -From ab2439f80bdf94e2382efe941cf827da6710b5d7 Mon Sep 17 00:00:00 2001 +From ab4675324505ddcdfecdafa1e336f2c83e1b80f8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ab2439f80bdf94e2382efe941cf827da6710b5d7 ] @@ -56 +58,0 @@ -Cc: stable@dpdk.org @@ -65 +67 @@ -index 7694140537..4b5becc10c 100644 +index 5bf637a0cd..80d2a60473 100644