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 DD9EAA04FD for ; Wed, 9 Nov 2022 18:09:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4A9A40693; Wed, 9 Nov 2022 18:09:45 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) by mails.dpdk.org (Postfix) with ESMTP id 96AD6400D4; Wed, 9 Nov 2022 18:09:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WvonSRyRnPtoJhkZxjVKREBbydHgjVcmCQx6O6iicbgjzD+S0lZU9irEjTkqux7FRzyut58js9YwWkSDzWW9e8b+CebPISVDjKtYaJJcuDSuOReZacVZKcOsl5Zw5HySTFFwwghZOD4VtXVyP3WDKukyjCJt6Z/eGYvHOlTVE1HUx/nqGJTX8JzW7qyA5CIxescyq/ceMsaYHXL+FOpVe9kGPanmL1adwRNgaIeR/VcCFC7P3srR/FtVFeoaImKsIcg4MtuaH/nQob6NASDtbfJv8xX9s8oP2F6oG3mEEWreHHbnQFB0YJLLns158tzT5ztv1j6lLumAUkivlpxWkw== 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=YBUwl0IIPoi0fTo/4E/GuVZ84z0IlEbpO/YyN9QRwFM=; b=XyZfvrzD01ZMunrMqKRpF5K8K0B1ZReqt/GJI/8lJ/1mjTpEBC5ScAWwtNgURSvPGvSQMPYmxWSHMxOKOe0RVHK2p5DnSDDJgZ/EDrpOk/CIctpowNAADOkZ3njvdLIp6JXYPSR/gvm+FGj99V0PkstiDfbgQR94OCDkOtok0n+gTv5ozed/PAhAGGmuMDLhxELEasQ9GQlcCPQlOaWoAKs894fWpR2lwCza7dQ8gGDtPL/YtpUQq/yoLIcrhyu3xPmc4ngt0Jh1Mle8nvX7Z8wBTdQT+ywIjvTAGF77SFbT/1HlhpspNRQgQNBhFW/TBEZJPgae/JzYu7s/YnsXew== 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=YBUwl0IIPoi0fTo/4E/GuVZ84z0IlEbpO/YyN9QRwFM=; b=hm5LmYnVcpej870hmO2YP0Z6hnuF6O0iGz/99tSocsZ0vRKjadGeK7rLL4zoyaxzaSQJ5U1QUW3Dd6EUbWQRc+IdtZh5aScjRb9J1ZvkBUQYGh/lQq7OrYX5oW956GcHUy5y2qLWB5cRqF4lyVubAgCaMGnd/jcsCMvx376euowD8tItbDMfiIT2oBgnOaD7RMXt12QcwMkLfuKWdflMxIaAlgzWpUwKk4dCcSPWn461P1+z2UcXlTYysPXteTlRglZlzqOhpsJFDUG7/NLdFDpynIaqbM0V3zH5OZJgma9UIKN+VyfNBYF9tNKe/yzdlp9Fvj5xrxgIj5HOu9k1FA== Received: from MW4P221CA0025.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::30) by BY5PR12MB4132.namprd12.prod.outlook.com (2603:10b6:a03:209::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 17:09:40 +0000 Received: from CO1NAM11FT110.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::60) by MW4P221CA0025.outlook.office365.com (2603:10b6:303:8b::30) 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 17:09: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 CO1NAM11FT110.mail.protection.outlook.com (10.13.175.125) 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 17:09: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 09:09:35 -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 09:09:32 -0800 From: Gregory Etelson To: CC: , , , , , Aman Singh , Yuying Zhang , "Ferruh Yigit" Subject: [PATCH v2] app/testpmd: fix interactive mode with no ports Date: Wed, 9 Nov 2022 19:09:18 +0200 Message-ID: <20221109170918.2887-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109165410.1326-1-getelson@nvidia.com> References: <20221109165410.1326-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT110:EE_|BY5PR12MB4132:EE_ X-MS-Office365-Filtering-Correlation-Id: 0224b4bf-c9a3-4cea-3d54-08dac2752fba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o0r5YWXR970yojtBwDtQPxa5/wpyETWY3abzSWI+vH2pQ8Xq1Au5Fn+QCDYWVDNElbib+v/6PFkKS7tb35JAaDcCHi0Ke4lnpTaB4PF8TvUNY6FqThIGn6Kd7JEIk/bHob1tiYbRJhCX4NdMRWZcRKuryWG+IAlNi+h9fhV9Smx5CcBbSsoSD5007J4Dgf9whYIX040zxm+aKiGo3pUtqv7x7v0fnQPaPkGxMBQ4raugqpyVbwgCa/tR1AbRZ+vQWPPmFLnNHFG7FC89wDogwexCA6DntxqUJ45MbOD0ErFqwMNTPqhNeWbWIPcwPWJuecSIRx7AwI7S38M2OPXt+N4bV4UiFAdgi52OAFyk5JFT+7thaFkT4twCtMfWI7iNlWzB9BKx5MBX2ovL51RZsYBT3eK0JBxzA1DvL32Yl7hSBiAFsFb4xc6F3/9VPJvj6CI72wyquiL9z4u/apHsJHi2tc44NZPN20puDBSQ+ssqc0tR9h/tS+Dw9yClrT32c7SpXgXX8K9a17kPNC/SJSHlFv1U4PVpMq6RA6QrEoQl/kVXd7GFwTiacVbn1F02snVzsr2No3gbgeJw4UMcsO9sV4Rt2QYmxtw4kIV3c/GaaKHG1junYhKpMuD39/hCWsuW4cpuam/juoZxP1pspIEdOgQVPIEaQTVFLnZGODMTANwIrZSNjtx3YCfC5VtDvVRHRmzXMXfUCk5FbjhD/oFWgLr8/WFLR4QeFTI2CMIUKq1fzczOPZ5hbEYkvx2uuPBp8+ICrJpkHL4HdNvVVA== 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)(39860400002)(346002)(396003)(136003)(376002)(451199015)(46966006)(40470700004)(36840700001)(426003)(82310400005)(478600001)(40480700001)(6666004)(316002)(6916009)(54906003)(36756003)(47076005)(4326008)(356005)(41300700001)(26005)(7696005)(7636003)(70206006)(70586007)(2616005)(8936002)(186003)(1076003)(8676002)(5660300002)(16526019)(40460700003)(86362001)(36860700001)(55016003)(82740400003)(2906002)(6286002)(83380400001)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 17:09:39.2480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0224b4bf-c9a3-4cea-3d54-08dac2752fba 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: CO1NAM11FT110.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4132 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 --- 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