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 B1EC44241B; Thu, 19 Jan 2023 16:09:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A3CC42D88; Thu, 19 Jan 2023 16:09:35 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2049.outbound.protection.outlook.com [40.107.102.49]) by mails.dpdk.org (Postfix) with ESMTP id 027E2400D5; Thu, 19 Jan 2023 16:09:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TRR4RNYR+CiXftWtbFaVOM/IyTaanUK+9/s5fDTmN21Bh2l0Krh02caA3Qq3o9icQ1CW44uU4eMkWzDeY8JsqvA9xkktWrJaiMpYT09WYjS5+LlCE/W/Fr6aGmPgsCHd/QYkcmJZFnKOALjqMCAMKakKmOsu1+R4VAjr92ZwNj6cGZNs8AaNKovjtU6pxC4RgkZIfo/iIfBhgrrRAAUrPN1IG41z0ua8SzQoxaLIkI43Yf1y0aJfSNS4fJV0vMboSe6AIIDDqgrMhzd399KZXpqVyhs4XnEbgzrqxGJZ9WG7sKtqrcrC9D14G9kCAown6f1c4vBLp0WnAj1krcoYog== 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=Z6ej0aioTybJtWnhJeQ/uQ4rhHRrpD5pPmm61cseyCg=; b=X/9CnP6udfkajUsoLXjABcRsBNpyh1cs/oYoM0rIOkSRVlheLqyunPtSgiJLU1O17lzXTCVaxgAICtymnYcLuzZi1cx5J9EHeWa/fDfdChD/oLNH/wXEfqna597XTHrvZxU1YyT55ECaN3gBsMFXycn4J8lBp6psHDjZ9bDYeb9THUwqBoMakIJlkRhgPyyIHAX8upvWk199FT0Xln/diI9G1r/IJFe/4FbLfBnWDb/ltQsA3MT5xVWZ9v72jhoXHzydEHjtT/WFk+OBItJc5iaQ/qhpx2o00nNDP+eZNUesVfv5PyrnlUJtvEiaYt3fVaP1Dufl21T2hIsCfN0D6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z6ej0aioTybJtWnhJeQ/uQ4rhHRrpD5pPmm61cseyCg=; b=xNh/F55emxOt9nM3d3PlR50d4WyX55G/x2KhBRYELy+WLuiGkJiznCKQ85x4h/3JNKfx3F15iWM2u54xubupZw3IjzwSnxy4wZhZBhg3cQlm+bNa4Sw2811ASSdV/rPCK1r0ohQP8jihzmfdh9pRDFBJUIzXcRGFUyECfCOWn4M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MW4PR12MB6974.namprd12.prod.outlook.com (2603:10b6:303:207::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 15:09:31 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6002.024; Thu, 19 Jan 2023 15:09:31 +0000 Message-ID: <2c0f5afd-4408-6e87-9183-ade2f8ea46ce@amd.com> Date: Thu, 19 Jan 2023 15:09:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: "Singh, Aman Deep" , Gregory Etelson , dev@dpdk.org Cc: matan@nvidia.com, rasland@nvidia.com, stephen@networkplumber.org, stable@dpdk.org, Yuying Zhang References: <20221109165410.1326-1-getelson@nvidia.com> <20221109170918.2887-1-getelson@nvidia.com> <9bfc0585-beb4-e4ef-ae1e-2d5b241136f8@intel.com> From: Ferruh Yigit Subject: Re: [PATCH v2] app/testpmd: fix interactive mode with no ports In-Reply-To: <9bfc0585-beb4-e4ef-ae1e-2d5b241136f8@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bc::12) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW4PR12MB6974:EE_ X-MS-Office365-Filtering-Correlation-Id: b8dcff6c-3015-48a5-83e6-08dafa2f2a51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: shPFVxvzxOIePKaOuvx3yr9vuwHWqJ1SN//NXsSXaNUGn86J89kDxh5p7jKk8PHwEEqy31NeK5r2VxSv6H/w6dhllaMMwJZtVQWMLCHwoOxg+8MAN+9aYM0wT3720wyAqVnqFoQEL9hb/Sg8pEvmhCZiiveeCD1DDdRJQuTa40mHiSAQAzjwNKqJOo5HIWIh9QjVHDMJK3fM7DTyDWm+mezoElIpoyeKb7VTyVNPFWOmJSEK3mXOB6Wyo7SZW97d/2r+60glE7edwLSGxlpm5vOF/4tpji+Tzzfr1W9o13JpfAFxjsQTUbpp57WVomsnBOG7yAovAZVotp0uFr/ws2kMM59btNPCm9n3w8AnXLKF7aSObJRNLtSEd56+hqi1fUVTrf0RsXrD4rizKVSVQxkZl8ztg8Ts8gnZHfCfzzyjGS9G5AXcQK5RiENbVce9V3vWpudtPGsGXAB8SgZtOUe4PI8lf1dPyQSqTUjHR+fpV9tvE7ZGOqPZmQrsgkmg9+RPwbCbVfevXjSHMnXdv+3onEyRU2q03vCH1UrAo+bADr7PJaXOW7hvaeMQR4WTs0/Jzl5opiaLXXm6TiBgVpCKd7BDXafiUFwZ5lM+F9uI9opInfIFZ0GtRMamcFxb7OWSHH4Z2IItf3Lh8n4uX0P8BPQQIW6bBfgfylvN9QE7h5ADOhY53CuJvS8fyzzLhzzOpKv0iN5oaB3HFw+ECH7nLiEL+csqxJDri5YxPnA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(366004)(39860400002)(396003)(346002)(136003)(451199015)(6486002)(26005)(66556008)(478600001)(41300700001)(6512007)(186003)(86362001)(31696002)(316002)(110136005)(2616005)(38100700002)(66946007)(66476007)(53546011)(6506007)(36756003)(6666004)(2906002)(5660300002)(31686004)(44832011)(4326008)(83380400001)(8936002)(8676002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UWhiRXA5dFNNSEc5RzQ2elVVSVJxV2ZiZUJDYnlHOVZYcGdlNENUSEhTNzMv?= =?utf-8?B?akRmUVpBUFhKY2RLWGxSd0xNQkFPVnZ3Z3VWcUF3L2lXdkV6VjhHdDhsQXpl?= =?utf-8?B?OE94RTRsRVZSTDBYNjF4OXNMSEZFRmorWjJUc0F1NU1Ea0hHQUtEdmI3T3pG?= =?utf-8?B?aHI0Unc0eGhKbytBZ3UvcE1ENW5qSm93dnY4RWtUWjdsa2pqMnY2aDEvb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rSnBWMmhQYXhVNHowaDZXOUp1cEpjMFQ1ZThvaUNESGNyMmFz?= =?utf-8?B?b1JKdWEwdlk4bnVMcEtEcytjODdiMmEvSTB1cDduajl5TC9zV2tBWEdONzZ0?= =?utf-8?Q?KwcyKyPW1LB7Ot8Oo7FPWjxwC?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8dcff6c-3015-48a5-83e6-08dafa2f2a51 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 15:09:30.9562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kVrvZ/z2rpxYJZzIAbi/QHVo3+A4e15ihHACjH1XJg6E2uxXqtMmDJUh2Ctk4JO5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6974 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 On 11/16/2022 4:23 AM, Singh, Aman Deep wrote: > Hi Gregory, > > Thanks for the patch. > > On 11/9/2022 10:39 PM, Gregory Etelson wrote: >> 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. > > I tested testpmd in interactive mode with no ports. > It did get into command line- > > $./dpdk-testpmd -n 4 -c 0x1f -- -i > testpmd: No probed ethernet devices > Interactive-mode selected > testpmd: create a new mbuf pool : n=179456, size=2176, socket=0 > testpmd: preferred mempool ops selected: ring_mp_mc > Done > testpmd> > >> >> 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) > > With no ports, start_port returns 0 so it doesn't exits. > Hi Aman, I think patch is for the case port exists and 'start_port()' failed, in that case testpmd exits. With patch, testpmd only continues after 'start_port()' failure only if interactive mode is selected, that also looks good to me. Gregory, Only for non interactive case if 'start_port()' fails, application exit value changed to 'EXIT_SUCCESS', which is not quite right, can you please fix it? >> -        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, >