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 CF8DD4241C for ; Thu, 19 Jan 2023 18:23:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA03F41101; Thu, 19 Jan 2023 18:23:46 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) by mails.dpdk.org (Postfix) with ESMTP id C9F78400D5; Thu, 19 Jan 2023 18:23:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N3T000AU29l5GUwpCJgZVsU08OxAvBk+RHBaKvYO7xQzAuoonhSKzBthDeU8wErZc2HameKg+6BhmvDT7zLwDoEojccu8Xew+aR68H9Q0xX8djDVweCa1VQUwG/AdlMcvDFWurds7ygjwFC2ec6wJ4HVlcCNULbxc5ilGMTNCdXYw6zzvvwu4e/Rhz7bt9QTd9K/D6oEiBVBXKWhnwrzUrZNBuH6XB2HTVfRE6S2a/l7qL1U88GrZiZn1zeToAbyusHyyXPpjTFdklwth7FthfPo0MwyMW6kGDYr4wOOyLUBBt911fu0bl/a5V0vw8xYbI81xHa3WpZFBVTbTmfxzA== 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=eJXc8d1eE2Qo1IyXyEMHj28E7BnViGMERsTlEodjBrQ=; b=AEF9CuGk+HbrdNTUrHIHST7MAH0UHo8Hmf1w6u7YfQNrrEXEnJwBecW6Ma5W2idbyyrCRX1npBkM8Otn7ddt6ZagQip/XONJZAeO8yvPYVGjz/hyC59u7OkywBbkI4OYEBKPvFRlu8qpPdtPOokCs7PEE+nqGUOCzQ3Eyyz68bp+kaMiXU7HPVGM3E2cAuhGxavUpaYih3KQVAQOGo4f16WAvqq41RNndLCdf9S+n2UhcyaymKQ1K8DXMFoXry5Kku/rhUzUEPpCpIk5AVY3fb2O3OjAVpRKZ4FJjbe6FpYXv5dcY4IXzWj/HvfFWCD9ygqP9ALEcyDgTy6k3KTmzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=eJXc8d1eE2Qo1IyXyEMHj28E7BnViGMERsTlEodjBrQ=; b=oQ14kvLE2Ex8Ba4mmikZ56iG2QEVsH7VZYGrWBpwJWLehjU+gZy9sAM21oCvcZdfZ3cxZ5QZcGXD+wH6ujF85JD5DJn/LnIXjIxXZSJt2kUI/XFFUnR9ozMIHDsY05WP8+bdGtHOElofUC4pxjgwrI6tKQCwK4Q8nfJWleJiHsc5Wr/TCOZnhhfFbsfkOBQkbkd+dSJEkqpUR53w/y80K51avJvqzbsglPnNb/R+8xONTOMorjx1XMUN6U4l66MBJswc5c4p75smVeSDD70+uYGhVDZ/5y+T3jyWagu/2IYxpiDAt8qULLTDeqiCNWWX+yVwB1CDAK83p2u/8pMIuw== Received: from DM6PR07CA0122.namprd07.prod.outlook.com (2603:10b6:5:330::18) by CO6PR12MB5412.namprd12.prod.outlook.com (2603:10b6:5:35e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.25; Thu, 19 Jan 2023 17:23:42 +0000 Received: from DM6NAM11FT103.eop-nam11.prod.protection.outlook.com (2603:10b6:5:330:cafe::8a) by DM6PR07CA0122.outlook.office365.com (2603:10b6:5:330::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.25 via Frontend Transport; Thu, 19 Jan 2023 17:23:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT103.mail.protection.outlook.com (10.13.172.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 19 Jan 2023 17:23:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 19 Jan 2023 09:23:26 -0800 Received: from nvidia.com (10.126.230.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.36; Thu, 19 Jan 2023 09:23:24 -0800 From: Gregory Etelson To: CC: , , , Aman Singh , Yuying Zhang , Ferruh Yigit Subject: [PATCH v3] app/testpmd: fix interactive mode with no ports Date: Thu, 19 Jan 2023 19:23:12 +0200 Message-ID: <20230119172312.15418-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109170918.2887-1-getelson@nvidia.com> References: <20221109170918.2887-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: DM6NAM11FT103:EE_|CO6PR12MB5412:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ba96c81-3588-4dfd-297f-08dafa41e903 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0txCArjAiWjP84NJb3SOsQQX5raipJaOV/aKyk7FYTTqjyudPyMfouWFv6+TH8ALEU1jONrjlq3AmWGqvPOf6IlJl9MeI7CMBBMNcqhxXjxuOHvvKIF5t28wla1MeJ14J5GsPH29wU+tYk4ScZiqlxwbIcaMGNAr+sfaop77KRgNX533SGscQQ7sqXzGq3Wy+e5641ooW3lc8gfZdXMTQS1FAUJH7SdW6sN22MXzT/msmfhfz33rM8qCYLdRKY26tbC9ovmdIb/yjysX9M+mx8RfHWZzjzbenTdhN9M+lDZ8ENw2Q9eccBsoOGcLgaLD6Zo6hjnW06BqMD6RpWeOoH1jCNy9FGBEJbLHXIevnbPPBjX4DbBLFHX8lO4KXv8ysM9ZqjFBYS2O8joh362ByzYWEUn//utzGZdJZjsfk4YqJWW4guYHbVvOUFe+YGcDxaprUMTYqBtZ2Iwfz+yZUAlUqjZSoFl7nQJtcX9nVyjrtAd2EOPy4dFbr6ZZTp1NI3Ih5vzVKoc0xftquv24Iohrm5zFcTf6tmZXmQadQcU3DXgGxIYIdyOA69o1EbA7CUZcM5sPPrIk6Yk/HErvuwg4bGHCyKxcoZbDoDx/Zyb1149345tKoJSqkYyDkCCs7OuMRE3YlngDmWFh4V817HPn9Ucgg1zSLrNK0Z0GpjlO0FCKKadyesxQre1DU0ISPSOYvpxwaN71ljfNZ0Xl7Q== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(8936002)(316002)(40460700003)(478600001)(36756003)(7696005)(6666004)(86362001)(2906002)(2616005)(82310400005)(7636003)(426003)(54906003)(47076005)(83380400001)(55016003)(1076003)(336012)(70206006)(70586007)(6916009)(8676002)(4326008)(5660300002)(82740400003)(40480700001)(36860700001)(16526019)(26005)(186003)(356005)(6286002)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 17:23:41.4057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ba96c81-3588-4dfd-297f-08dafa41e903 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT103.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5412 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 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") Cc: stephen@networkplumber.org Cc: stable@dpdk.org Signed-off-by: Gregory Etelson --- v2: Add Cc. v3: Update patch. --- app/test-pmd/testpmd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 134d79a555..3d336a4d3e 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -4483,8 +4483,13 @@ 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) { + rte_eal_cleanup(); + rte_exit(EXIT_FAILURE, "Start ports failed\n"); + } + } /* set all ports to promiscuous mode by default */ RTE_ETH_FOREACH_DEV(port_id) { -- 2.34.1