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 0807DA00C5 for ; Wed, 20 Jul 2022 10:23:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 034BE41101; Wed, 20 Jul 2022 10:23:33 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2079.outbound.protection.outlook.com [40.107.92.79]) by mails.dpdk.org (Postfix) with ESMTP id 57BD14003C for ; Wed, 20 Jul 2022 10:23:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fa9tb20XaleHvnP2kbfvKF+NpWA1EZ4m4AELuTNwqFHPuKnS9G2BIG7yz+wRFva/7jfoI0yCAu4+DTlztGSgCvpkIBXwavBpe62UimUY3x4j8G9fpryrJoZ0CHXQD6pXnl3eN42JV3e/Qf60XSg0Cv3KxlynZ2QsVd3o48dsY9kYxaLFijRSSRHh04T7DPGnAyKYh8vhF2umHiOUNo3fGDGvEZakFSsiYpsoEcK7x1djvLgNOQNCLZE98gKAyTQXRYXhBKvJFlAxwJ/M/aA9tdfnMMyWSMNNm/ieB9EY8ErhbVQhIIWRp8sYQUZyR7Zw3TkSTwkDcD/Wqrm0s8/Gjw== 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=mDa0x1CBv5gqLnPb3TXf7gaOZ8K0moa2VKh686zOWqg=; b=e9VE+g/isHFRodJD5kdWqMc/PL5rT1fyXDNHds8quCxe2y6T+lmcXmXsEg04frJQlD2tgGOAzFUiN8Gg/uuXXozO5aDs4vXxocas0pgYG8CHh7nmXOt1LEjikarcBroxAmjcl5B4uoSUOdM1dCemIY1octujssAx1vuFvfQF8vTrhN7t0PLOHPxWz3ddB2dFpN/mXcx5e2L2BrApAGA2FzuDdBIFls+avEvKyfsiyvl2deoD0e4Ff+isuCp5KquLK5Gw8YUEC3Rs/YIUyPoj6ZqUhDwrOil+Qwql0Asl0GNZj/sAE7fS10JLjkEHDEPtsUZ4u6gluTqOE83IqHoYLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=xilinx.com 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=mDa0x1CBv5gqLnPb3TXf7gaOZ8K0moa2VKh686zOWqg=; b=Xia9b9HvDy94muQmH6QBdiUnTrEtAzWl2WH2hglZzKMIHSvuABRF2n6YuxOsdIDFGgNTVIHG1guGeHv+YhZ2BSKgEUUtRKsblcKxISFTzalLf28PXyM3f5DIpG5NAq4dPdDy1ycIK+u3RseV1BsoORwPulNOwV+xO0Oh0XH1GYKgok9ZEYWJY9kM0LWtw/oJrKQ2XJ1AxDgKONA89FMo0nmm5/0hNuszRmwXNzi5NvUWODDpA7HqeKhPaRYWC73JziKl7REscTWOhx0nVUxjFZcmLmuiqjtb8q0go1GDMefKB3/wOEre8mjD5wgsYm/zlZQ9VxJD42iiQZKOr/8Fww== Received: from MW4PR04CA0127.namprd04.prod.outlook.com (2603:10b6:303:84::12) by PH7PR12MB6810.namprd12.prod.outlook.com (2603:10b6:510:1b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Wed, 20 Jul 2022 08:23:29 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::c9) by MW4PR04CA0127.outlook.office365.com (2603:10b6:303:84::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.21 via Frontend Transport; Wed, 20 Jul 2022 08:23:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:23:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:23:28 +0000 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.26; Wed, 20 Jul 2022 01:23:26 -0700 From: Xueming Li To: Huisong Li CC: , Min Hu , Dongdong Liu , Ferruh Yigit , "dpdk stable" Subject: patch 'app/testpmd: fix bonding slave devices not released' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:48 +0300 Message-ID: <20220720082132.3954126-19-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5031602-52a3-40d1-b75a-08da6a292019 X-MS-TrafficTypeDiagnostic: PH7PR12MB6810:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?3lEodxqu27JnznSK4BqzORfIsBo8EBuwhtMkJi/M8JsANM0SD/POVSHBb5sN?= =?us-ascii?Q?WseD/730YoJ5uBIw5eehR5he61+5GfQDR3T9Ikq+okcljxBj8Ot9ARVZL4fB?= =?us-ascii?Q?O16FPFuTi5vTMJR+AI4Qy7yG7GIvfvNcA+B4u8Q7v29yOc4CQ/110z1kaIdG?= =?us-ascii?Q?YHUsHk8dSvig/ZbRC3gTQLr9I72jR9rSbaKxCeYFQOrirI+fjSWV0/H2qSp0?= =?us-ascii?Q?lWFgewbBneDDR/DF82Ez6XRfo5Phq1OElfsS3uKMExBzsm3QOW62qVeyV/e4?= =?us-ascii?Q?M2giIWjW4GPy8FgI0JgZpX0Rb6tXLffuOYI6udsNaWEawy2WwL8I9FYCJyso?= =?us-ascii?Q?AlO2sfeH3tbRsgoeYs8sxYx8vh67pRxQTHAc2ZDDTreei7bPYOupM5XSs8FT?= =?us-ascii?Q?Gxh5YD748He+4Q+yVfiPlkTYN04GUjw4Z7kWHIdmx9J2NsOaZCk/758FPb5B?= =?us-ascii?Q?/rfIZrzG6xV3OmVfsSJGxafWPfjIUbmUCRczlowGxLNiISiofy1U7mB/Tf0p?= =?us-ascii?Q?ktLfUWpdZavztfFl/v7fPVDRa5jipIvpXeM9D7Qs+mYoFMO0sVDUE3puozEP?= =?us-ascii?Q?060DvdV/JxC59UUEmRmkRzXO/WDztdqdjxOxT4mH0MgWuo6vdAzXPAwBECzy?= =?us-ascii?Q?uhqID5XtOM0BQheSIxa5f9AIM1E3EKCb2aRVpHWt5yaAVdRvYtOC32m13H0m?= =?us-ascii?Q?Klmq7oc3ojv2ZLeIsDJ5C4KywTFoL80W8SaDuXdY4BRQ3Ae8RZtV0TSm53HY?= =?us-ascii?Q?FO/HmyEC2bLpKD/ARdtpEmPn2QH+DGDLhHHDNDgB5GqS7bzSmuAfPH6u2TIY?= =?us-ascii?Q?uyRvqbcCxd4WQs6NY3ka6/mtOiwxWKNjc3izMlhOA6Kf6qJlFB2c7fSGOnhD?= =?us-ascii?Q?EwnAmXLbrKnJn192e8lgP+T1u25JjIMuku1GFRhqfyfARzw8j/cVU4DxFQjb?= =?us-ascii?Q?5idWokOSRhHvpWFqXTrtYg=3D=3D?= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(376002)(346002)(136003)(396003)(36840700001)(46966006)(40470700004)(82310400005)(41300700001)(186003)(16526019)(26005)(6286002)(82740400003)(356005)(81166007)(2906002)(6666004)(1076003)(7696005)(2616005)(53546011)(316002)(36860700001)(6916009)(40480700001)(40460700003)(55016003)(54906003)(8936002)(478600001)(47076005)(336012)(426003)(5660300002)(70206006)(70586007)(8676002)(4326008)(36756003)(83380400001)(966005)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:23:29.0012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5031602-52a3-40d1-b75a-08da6a292019 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6810 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 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/22/22. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/50c6ddd64239edff3d2c3dc00c3b10569443127a Thanks. Xueming Li --- >From 50c6ddd64239edff3d2c3dc00c3b10569443127a Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Thu, 9 Jun 2022 19:49:21 +0800 Subject: [PATCH] app/testpmd: fix bonding slave devices not released Cc: Xueming Li [ upstream commit 3889a3220c9b93f07dfdf95e30b2661e6e3f698f ] Currently, some eth devices are added to bond device, these devices are not released when the quit command is executed in testpmd. This patch adds the release operation for all active slaves under a bond device. Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) Signed-off-by: Dongdong Liu Acked-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 1 + app/test-pmd/testpmd.c | 41 +++++++++++++++++++++++++++++++++++++++++ app/test-pmd/testpmd.h | 2 ++ 3 files changed, 44 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index a84568aeea..83bb041484 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -8233,6 +8233,7 @@ static void cmd_quit_parsed(__rte_unused void *parsed_result, __rte_unused void *data) { cmdline_quit(cl); + cl_quit = 1; } cmdline_parse_token_string_t cmd_quit_quit = diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 96e0f2d212..c29f1f153c 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -217,6 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */ * option. Set flag to exit stats period loop after received SIGINT/SIGTERM. */ uint8_t f_quit; +uint8_t cl_quit; /* Quit testpmd from cmdline. */ /* * Configuration of packet segments used to scatter received packets @@ -2857,11 +2858,39 @@ remove_invalid_ports(void) nb_cfg_ports = nb_fwd_ports; } +static void +clear_bonding_slave_device(portid_t *slave_pids, uint16_t num_slaves) +{ + struct rte_port *port; + portid_t slave_pid; + uint16_t i; + + for (i = 0; i < num_slaves; i++) { + slave_pid = slave_pids[i]; + if (port_is_started(slave_pid) == 1) { + if (rte_eth_dev_stop(slave_pid) != 0) + fprintf(stderr, "rte_eth_dev_stop failed for port %u\n", + slave_pid); + + port = &ports[slave_pid]; + port->port_status = RTE_PORT_STOPPED; + } + + clear_port_slave_flag(slave_pid); + + /* Close slave device when testpmd quit or is killed. */ + if (cl_quit == 1 || f_quit == 1) + rte_eth_dev_close(slave_pid); + } +} + void close_port(portid_t pid) { portid_t pi; struct rte_port *port; + portid_t slave_pids[RTE_MAX_ETHPORTS]; + int num_slaves = 0; if (port_id_is_invalid(pid, ENABLED_WARN)) return; @@ -2891,7 +2920,19 @@ close_port(portid_t pid) mcast_addr_pool_destroy(pi); port_flow_flush(pi); +#ifdef RTE_NET_BOND + if (port->bond_flag == 1) + num_slaves = rte_eth_bond_slaves_get(pi, + slave_pids, RTE_MAX_ETHPORTS); +#endif rte_eth_dev_close(pi); + /* + * If this port is bonded device, all slaves under the + * device need to be removed or closed. + */ + if (port->bond_flag == 1 && num_slaves > 0) + clear_bonding_slave_device(slave_pids, + num_slaves); } remove_invalid_ports(); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e97ab5d2a8..745e673b8d 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -24,6 +24,8 @@ #define RTE_PORT_CLOSED (uint16_t)2 #define RTE_PORT_HANDLING (uint16_t)3 +extern uint8_t cl_quit; + /* * It is used to allocate the memory for hash key. * The hash key size is NIC dependent. -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:00:59.647279332 +0800 +++ 0019-app-testpmd-fix-bonding-slave-devices-not-released.patch 2022-07-20 15:00:58.704333841 +0800 @@ -1 +1 @@ -From 3889a3220c9b93f07dfdf95e30b2661e6e3f698f Mon Sep 17 00:00:00 2001 +From 50c6ddd64239edff3d2c3dc00c3b10569443127a Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3889a3220c9b93f07dfdf95e30b2661e6e3f698f ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 56a369e104..a59e6166d5 100644 +index a84568aeea..83bb041484 100644 @@ -27 +29 @@ -@@ -8918,6 +8918,7 @@ static void cmd_quit_parsed(__rte_unused void *parsed_result, +@@ -8233,6 +8233,7 @@ static void cmd_quit_parsed(__rte_unused void *parsed_result, @@ -34 +36 @@ - static cmdline_parse_token_string_t cmd_quit_quit = + cmdline_parse_token_string_t cmd_quit_quit = @@ -36 +38 @@ -index 04c39adc21..205d98ee3d 100644 +index 96e0f2d212..c29f1f153c 100644 @@ -39 +41 @@ -@@ -229,6 +229,7 @@ unsigned int xstats_display_num; /**< Size of extended statistics to show */ +@@ -217,6 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */ @@ -46,2 +48,2 @@ - * Max Rx frame size, set by '--max-pkt-len' parameter. -@@ -3202,11 +3203,39 @@ remove_invalid_ports(void) + * Configuration of packet segments used to scatter received packets +@@ -2857,11 +2858,39 @@ remove_invalid_ports(void) @@ -87,4 +89,4 @@ -@@ -3242,7 +3271,19 @@ close_port(portid_t pid) - port_flow_flush(pi); - port_flex_item_flush(pi); - port_action_handle_flush(pi); +@@ -2891,7 +2920,19 @@ close_port(portid_t pid) + + mcast_addr_pool_destroy(pi); + port_flow_flush(pi); @@ -96 +98 @@ - rte_eth_dev_close(pi); + rte_eth_dev_close(pi); @@ -104 +106 @@ - } + } @@ -106 +108 @@ - free_xstats_display_info(pi); + remove_invalid_ports(); @@ -108 +110 @@ -index b90bba659a..ab333c7324 100644 +index e97ab5d2a8..745e673b8d 100644 @@ -111 +113 @@ -@@ -38,6 +38,8 @@ +@@ -24,6 +24,8 @@