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 440334241A; Thu, 19 Jan 2023 18:16:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F184A40223; Thu, 19 Jan 2023 18:16:36 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2073.outbound.protection.outlook.com [40.107.92.73]) by mails.dpdk.org (Postfix) with ESMTP id 583BD400D5; Thu, 19 Jan 2023 18:16:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PM8tcC0gBXWgj20+QpYvFjlzdFGbg33vCNEA2uvMWptqppsadDUtyFKktKI5XbmZq61nUtU+WeNllAn32wCdFpPkp3WPUMpwk7cABKAFnZ1XFqD6QlovYn+xcA9xPoJkzWvc5OH/TkNX1kMUFfz8hZN6bIzgvluNhv7jxSIgfyY39fFOU316qsgHfXR0scVCYbjPHCpXwDUyNS0PhHwJSlN7xKqxuFOA/gXwcJq/Dbt7NwVNn9LNDKSBFIPv8rOiPEVwTVgDr8K28A896mgclhvDLCwWafP4i8Rt1vLt8uvYW9biPvw1q3ZjtsC1OYcRsqWjhuSjxe3R12T69cyLDg== 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=Z1qV99HW93VC9+N+Db256T24eb0geeZ5m67F2cEqqjB4b5K2LikT0dMEAj1F3JQNDlEgwOmAQrEX4d9gCs6D24uyc71QU+wMHxfqbXRWBmpI0YKzUzP/hvCWZGlWt/7DLMhaJ9IoFDAxuR1AI+S8QM7HxSM1mFFYiLyRb9LUDrL3eVtvDSjmg+VrYOW4emeMbrEow4hKUHuoI+RtDNyvpNW/htEVgD/17kUO/JsNm4/8oOamRhSI6fNL5Ay7x3oFphnR5ihQg3jErVmEUpR/O0lPax/ZJrBI7fYjTX4pe8KmkX9r1LIzaIc6t4OPhVyS39VCcVdCfN8Zt/OPGtALFw== 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=eJXc8d1eE2Qo1IyXyEMHj28E7BnViGMERsTlEodjBrQ=; b=Wqb/8MGyvv5xpSUkeBXCX1zi3vaKotm7McBw9GArRqBg4CYLimf/+DcKn+7FSyWmr0fLFysp4GqWB+pGgJbLNztqAimgqhIxPY17rUzREvxmCL5VoEEg8nRiQlvbjf0KmTfmI6KawkChQPS+IeA3LI963PBWDk/aZmfwBI0Tyf0CGH5BdRT1BXv8uWqddgT1+X5Jj2CmIKciFRxCvaGe82bvtcpwtyrttJV6wcKNCaomiyFlgB3zQRsUVtmZ6tYs3M5x6aXm/bEPcMNyODV3StjO17e2lPAiD3kC5OcgdI4LVSVngsbgDdhi06etgqCJCipb748lb8hXdp20QLNCvw== Received: from BN9P220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::32) by DM4PR12MB7669.namprd12.prod.outlook.com (2603:10b6:8:106::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Thu, 19 Jan 2023 17:16:33 +0000 Received: from BN8NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13e:cafe::5d) by BN9P220CA0027.outlook.office365.com (2603:10b6:408:13e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.26 via Frontend Transport; Thu, 19 Jan 2023 17:16:33 +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 BN8NAM11FT085.mail.protection.outlook.com (10.13.176.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.16 via Frontend Transport; Thu, 19 Jan 2023 17:16:33 +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.36; Thu, 19 Jan 2023 09:16:21 -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:16:19 -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:16:06 +0200 Message-ID: <20230119171606.15242-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: BN8NAM11FT085:EE_|DM4PR12MB7669:EE_ X-MS-Office365-Filtering-Correlation-Id: d7df55f1-b945-45e7-c806-08dafa40e9de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: haibvbeTcTENVFS994eES+bV6pQhmXnaLlMh8q4bsVL+OHVC6jiILrocMPHcNBOxeFN2grAIV3qfYcKcwS6PFp0Pi/XR9mOg6m3SHzI2Hg2C3A7ukP2ZhkFlCuo76OBMYTrB5iLeGuMQU8dpOaQGIk1q9jH0qdbvMAy8BpOdYpQo5BiKi7ydAa95tlPh84iJgBwu3lGaibuAN2BGkMnfmnLmpy9/iLXflTnX16MhD6/964r/Tpj76bznKQo5wC9+AbeU04yQWBMdVD9CsPBn49yJkFFUDvt+eBale/j5s1zodaEnbLw/FpOTJxpjLy2HwkMmymJ6m54WWCOwilWANE3UextCf1EWHTFuH7xXyDFlLKjJ554GSZH2Ok5CDVRhMqFt6ct4vVoKsXapqBXbWPXJYV1l41+yIQ51556MBAxUZccNZutb6X8GJ5msv6Kb/4DC9fCVtfrw3HAAmDAlnejvbdSLbkk36Wcz6KDXX0+sFWXLxZnok/R1xj8vPm9mE8YHOi17O1JiGHhWfovvecSj91F0+sdomrgi1mXABl9UbCVGfPzdAqoALdgriH+/NQCJOVXcCMeqjPHG9Bnv799Jgd6nnGIMl6WPIGxAbghyUAjxBcffMSyHhoo4w0Ij4b5MxZU0UH44Kzj2TVbwxjQphNOvzA9wrRw1dpDTwEXpxB5NkBuO6Lmzml+vSXS7oZv4ZHgrQ2Q4CUVeWHwkYg== 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)(376002)(346002)(396003)(136003)(451199015)(40470700004)(36840700001)(46966006)(4326008)(2616005)(86362001)(26005)(70586007)(186003)(8676002)(70206006)(6286002)(426003)(47076005)(16526019)(6916009)(41300700001)(82310400005)(8936002)(36756003)(336012)(36860700001)(1076003)(5660300002)(82740400003)(7696005)(83380400001)(478600001)(55016003)(356005)(40480700001)(54906003)(316002)(2906002)(6666004)(7636003)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 17:16:33.2857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7df55f1-b945-45e7-c806-08dafa40e9de 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: BN8NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7669 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") 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