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 239FCA034C; Wed, 9 Nov 2022 17:54:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3F10400EF; Wed, 9 Nov 2022 17:54:42 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2087.outbound.protection.outlook.com [40.107.96.87]) by mails.dpdk.org (Postfix) with ESMTP id 60F86400D4 for ; Wed, 9 Nov 2022 17:54:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nc1RAnHrazkBn35YJ1dM6JqpT1uuIPaK+A+RwTl6vSZvmbupDnXwsxU9QY4SHqcOUGM+e4qd2S0maHpnJKtvfLwcfPwH0lSTc14/K87KOx7WmE+/2LD4NcU/YQVaiyOmD5DXs2zovrOznyYdlE//WhQLp/KsDPtxI/Avdnsc5p0My23l9cPCbQ2O7R9mNOiGTptRQkKCMP5NPxMcQVt9EuYFVXrn3DwgZwJGRP7WPRVyMfQEA2QsGvTFxjvPYWdyYokDS6SwDLsM+eq8CIUVTrn7KoAqbsdXEv3l5mVrhH89bLp5xF8lObmr+lyU1ttAKgJBUpiXQg6Sm6Z6uxlyfQ== 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=QzxcD+LkGn4kATDjfPbQCQUsaiVTaMfbtY17DjWLmgw=; b=a5V3MEWe5zz3F/76aDZ+XIPsJoHfF2kACsN2uC+bZ8sIQItRB4vOajacYaE1kU1SuFCq9NN1YwGH32xH8N4j2LWqDsV9FMBN8GLyvgOp4hgPS4S0Kqqzj5QWyaV/6NVSLznX7P+1EU4etehGSIHL82JIoNa1dxxuj/RPH37MWs2vXDue5zseQK5mOmLo+tWk6AxIXTH0Rur976K3gdjDyLCCHHr2OZJKlp92Sgv0pxPRUZxH6CGkzOtUeBmdBYShBTqlAelvo9sv4BiyhBsQQAE7ccM1iaT7RqXZW2tCHLeO+yV648D4lVvzhoSizywjZX48R8rzgwWNxeH2/VGyBw== 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=QzxcD+LkGn4kATDjfPbQCQUsaiVTaMfbtY17DjWLmgw=; b=TbIaIMOv96G/e/m3hsuJKL/feUQjHSRN5+5NIXc1+YpuUVzPEEwoN4o7XvfAe2yeuixjJiO2YhyOGut5+ys2ACkKQF4LUpbhivCzerpsICXicFbUrb0GQD2qI6vk+JRKm3tF258UIlJI7MEM32q6jLyym/va4AqY5NDais16iR+b0kHfRoCv/SVHo8+k/NXKw6a+OmfHiFiQA74kvg4njwrIpnO7wXaem2xqVkqpuYRVv516St1grxzbm3t6EjA2/cWXPT77R0nqjDrPRReXFIgSKlRkI+OQi7shU6bXv2CoitNJSlfNbC9zHur6mdo5QLxN4Gw4GZkpTt6tUD5GXg== Received: from MW4PR03CA0323.namprd03.prod.outlook.com (2603:10b6:303:dd::28) by BY5PR12MB4260.namprd12.prod.outlook.com (2603:10b6:a03:206::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27; Wed, 9 Nov 2022 16:54:39 +0000 Received: from CO1NAM11FT076.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::68) by MW4PR03CA0323.outlook.office365.com (2603:10b6:303:dd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27 via Frontend Transport; Wed, 9 Nov 2022 16:54:39 +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 CO1NAM11FT076.mail.protection.outlook.com (10.13.174.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Wed, 9 Nov 2022 16:54:39 +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.26; Wed, 9 Nov 2022 08:54:27 -0800 Received: from nvidia.com (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.986.36; Wed, 9 Nov 2022 08:54:24 -0800 From: Gregory Etelson To: CC: , , , "Aman Singh" , Yuying Zhang , Ferruh Yigit , Stephen Hemminger Subject: [PATCH] app/testpmd: fix interactive mode with no ports Date: Wed, 9 Nov 2022 18:54:10 +0200 Message-ID: <20221109165410.1326-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: CO1NAM11FT076:EE_|BY5PR12MB4260:EE_ X-MS-Office365-Filtering-Correlation-Id: de8d199d-af24-467d-45d0-08dac2731729 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CC3QQE9W/LX4By+mdN+WFsWHUJE74qPvtkXqNHysZfkvuCzLESDmcCwx46AFG2eB+PWIxrecB8DAKNGsrWmNWMWxYkK6ncEebHchX6D+mlgR+P9UP3P88QGdKRaoEvSUt0LRdT1pXijhsiuHquZOEfxn2RiKnomFhEpDcSZmZAN0MLvVD9HKWT/HeG1y0sEnTp/1oZEJVtfpvztsF7DbfohozZNNtp42yvPPB3DriXUigHeIiRTSo1jm4TSuvaNqq1EkMhRRGBl03X7bXu6l65rWM0bKSry31aA6fUCrPgJRBWWApwRu9jqJUvfBfMXflYaKERGo81xqHl4D9gcXzIB73aiwby0UodbSpNIJ4Kkr8LVLhsVBmwycza+mYMivsCLjGemj0u/uMOCwrWhp9gIsyTb26lP6ff9/sJ4PkwL1TDGUwJtHBqCByIO59dZDW1aaCaI9Yo8w4arzu3hb0hG4Tf2qCHA4n0ESJq5mZfWK8t3bRu+fooejXwizkRTSssNjmd/QA+gcXg4b755QMxM/fbhbyrvVnES3s2QQdZKEX54rPIjKvOo31a0C8i32LWqr0A2QROh6O/fczQJZpBlrH+uwoatjGET5/Bhr/c4FKknoKYNkZ9iX71uc8OXogyod9DA6M2RAOr8l66X0hw5BJSkzta+TS5XjddbE6APcSkDWJNJgsRRyk+iPedb9ajPrbtW5k+jIeasIp0+ba+4x0pO1PBQgtwrIy3MBySsGfMyYmga/GQWkWFBt0+f17sEuaUSo+qt6GUXgyR+8vg== 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:(13230022)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(55016003)(82310400005)(36860700001)(40480700001)(356005)(7696005)(7636003)(86362001)(40460700003)(316002)(82740400003)(186003)(83380400001)(2616005)(6916009)(6666004)(478600001)(5660300002)(54906003)(70586007)(8936002)(26005)(336012)(47076005)(2906002)(16526019)(6286002)(426003)(1076003)(70206006)(8676002)(41300700001)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 16:54:39.0392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de8d199d-af24-467d-45d0-08dac2731729 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: CO1NAM11FT076.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4260 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 Testpmd terminated unconditionally if it failed to start all ports. The patch allows testpmd to get into the command line, if the interactive mode was requested. Fixes: 6937d2103e22 ("app/testpmd: add option to not start device") Signed-off-by: Gregory Etelson --- app/test-pmd/testpmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7381dfd9e5..8517f376db 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -4433,8 +4433,11 @@ main(int argc, char** argv) } } - if (!no_device_start && start_port(RTE_PORT_ALL) != 0) - rte_exit(EXIT_FAILURE, "Start ports failed\n"); + if (!no_device_start && start_port(RTE_PORT_ALL) != 0) { + fprintf(stderr, "Start ports failed\n"); + if (!interactive) + goto eal_out; + } /* set all ports to promiscuous mode by default */ RTE_ETH_FOREACH_DEV(port_id) { @@ -4526,6 +4529,7 @@ main(int argc, char** argv) return 1; } +eal_out: ret = rte_eal_cleanup(); if (ret != 0) rte_exit(EXIT_FAILURE, -- 2.34.1