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 7556843C9F; Wed, 13 Mar 2024 13:18:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA0B540A84; Wed, 13 Mar 2024 13:18:25 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by mails.dpdk.org (Postfix) with ESMTP id E6D2C402B8 for ; Wed, 13 Mar 2024 13:18:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l23Yn0ylLyfeZqfp6YyK/EZaFZh5yLOpjv9EDRNGWF2xIj5nLJrIQQY1MRnb67yLIS4Px39v2oRbmdG4UV2g1SFlDerblnzSnFJZMrobFNnA4/BmNcKCXldHKSBLLzveLKTVo4pexlxCTmncxiVX/pe5HnFiD81QdS12E83aY2J48SkX0i+PwGXo46Awl430aZq0Tp8eaWAN07aGiZrs30jaMWKUeb/LFbpj8AOPVYppXCTrHbo+xCkAl+ADE0WZbXc3gJCM+HQZIdY0fLLSvKW+Ea3FxBbfg59/5JB2zeFTeiY5/fWRmVUuyY0YUwhvrzyxwsVW9mEEli/2/9+hVA== 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=byfOvtngaAZpHLXQuYGyoYiQDgJB1B8jh1gjHpWlOuk=; b=IBpwd6nizdFvnUHUXOfaMmhB3/frDXzgR1X0k21QGC4u8hW4MCydbvX0chtcsr2Iy5kN/SE2UBn/j5DY1UYOI19q0wQfIr0FHnOcs4/6jvOPoX2y4vFV2crMni34CD0uf+DoIRz7NQyfPt/9jE/G/atT+GZ9x8Dy4BcYdJ/mAGkGAaW2PO4RUIi+iEdJIQLPq2piirtqWoiCoiK4Mj7mh4XJP5UuUGvjdee5j7mgDgu3+/la7xX69anz+6eCyajO5VKw7rzt90Bxr9Vmxc1dEIxxhCYQvWQgrp8cXbROCDDqJvABLCjAtbVygyeV6uJ1YL57RctuQH0lzF66E6QMOw== 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=byfOvtngaAZpHLXQuYGyoYiQDgJB1B8jh1gjHpWlOuk=; b=juLJKcOMbS2dANvhn222lfsxNEmCI3tMWbjwf4OiabdEy/Qr7Pb+XHzxy7IB5AYfilSoAEtklpHWNLHRyJvAqjd0BgGFINAPiNra6qw3ZmnFH0JQgsIA4+e0kgOUNskO1lElD1g4YqoLxLzLgYYUw38v7tWo1VC/Gt/roHoYj6Y= 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 IA0PR12MB8424.namprd12.prod.outlook.com (2603:10b6:208:40c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18; Wed, 13 Mar 2024 12:18:21 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%5]) with mapi id 15.20.7362.035; Wed, 13 Mar 2024 12:18:21 +0000 Message-ID: <7c6732da-bb9e-41d5-a1ce-5d4327c2c67f@amd.com> Date: Wed, 13 Mar 2024 12:18:18 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/4] app/testpmd: check queue count for related options Content-Language: en-US To: David Marchand Cc: dev@dpdk.org, Aman Singh , Yuying Zhang References: <20240308144841.3615262-1-david.marchand@redhat.com> <20240308144841.3615262-4-david.marchand@redhat.com> <5d2efba1-ad6e-4e51-86bd-77d299b73697@amd.com> <378f35ad-d1cc-4d55-aa1b-7a2aec582cd8@amd.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYV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IZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DBBPR09CA0007.eurprd09.prod.outlook.com (2603:10a6:10:c0::19) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA0PR12MB8424:EE_ X-MS-Office365-Filtering-Correlation-Id: aa2d6450-347f-4696-c140-08dc4357ac89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yEhMO2Y9K7ACyUjGbpwtLJc765wXnDNPh+PdnVbxLKbzjSeB3LPQ9jOBuVi2MOukCf+L00Ek5qEau44ndBEGIr709MOx+8GeuForo4JuA2pj9Nsvj9sM8SsBIzLawkRx6NHchbsSkdAF7tuxkOIJYffHA9yMtLxwzsaSit6Hr1WhTm/sCb1BMdjyjutMu6oCVWco04cQksQBxyqGh04mtraZiPin81KkrasAiekuEvih1/gqZHpujDBhMUfndwKsLPXptzCV6dEWxnUQyy32eIIuDTheSyJJTabNamOhwCOdgeS9k+ppP8w9Mmgercz/PEJVw1aN/KriRlJQWVU/lCojGIu/+WQoKAuTcjtUbP0sTbT1PuyhsoH7AVfQX1waaM2akrPitAyWw/ZXPKV0q4/hbbeD/PW1JAoSufy9Dka+0kPqAwMlU+nbudKjtIpNHOk82+O3ga7+UBiOxp+WDx6odYq59Ke8dW+/0AfPX8d2d1YE1InXXbYnqYmNx7+NL4p7YiHZqTKbYAmOqPZMgfPzdTP/WtZSFLOmOFSiGLMBIe+Qp0nhmxEGswX3UPeZ0xeiv0kSdX5eU9tdzpv2+C9XWUv3z3/Bviy49ukUoTs= 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:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWRvVWNvSXdtYUE5dVBnUU9yQjZIR2VIU250YXVwczdiMC9Fa2QxUytvZk9x?= =?utf-8?B?Yk5vYkc3T29SVHZjUmoxQ01RZEtidFNuM3ErZDNXLzRvZ2ZHWlA0VEliOTNy?= =?utf-8?B?dDBJaktuenA3Z3lDeW5EVjVJLzVJNHdGMGQzT0huOVR0MVcxajF1MGNwNi9T?= =?utf-8?B?ZmNTbTdQWUczU1dUQmJYa25UNlpFTjk5OWNZK2pQa0YxUkpyTXFuM2pGVWJw?= =?utf-8?B?a1FKYXNzNHRxMXhTbGU2L2dST1VnQUtod3RIVlc3akhwM1VuZjRPWlhPcWRp?= =?utf-8?B?U2JUTCtOUm0vWlZSNnN5S3ZXK3l5QVVaTlZBK2VPQVdZclZCaktMeHBVNHhn?= =?utf-8?B?RWsva0dpbjlCMDhOWG5QL3hRZjFBNTNKZU5GeERBcmlTT2k2cVFBcTFWWGts?= =?utf-8?B?UXZLWm5GWUhYQWVJL1ppV2ZRb1NXSVZIaC9pYlhJaE15ZXFMWU5YWFhHM0Fw?= =?utf-8?B?K280MmN1akpYbXhLajY5eDFYeC9qUFRyQUV5K0kwdW54S21mZnJjOElEckR4?= =?utf-8?B?S0c5ZFM1MG03YW9OZk11b2ZMdHJxUlRnVFMzR0RGUENSaGtUQzhsdUZBbWlG?= =?utf-8?B?OHQ1MW5xTk10NWp6RTJJaDgzbDJCeUlqSW0waVF3cjc4bzcwSlZvWkI1aDNT?= =?utf-8?B?NG1nWVVLQUQwd2JLWXZiQ1h6RjF3dzBZREdjYnlwSnBhbXgrUElxZ3lwd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3Q0JSVDBHa04r?= =?utf-8?B?OC96MTJ4Z0J0bUZSQjlIcnJqSW8wM2VvMlkzRmxqbkt4bE1WTGxIS3N0aEhV?= =?utf-8?B?QmxpTWtMVVNiTEswaWhWc01meFpiNVB6c0xqMEU5Q0tWVy9IWng4WnVxaENB?= =?utf-8?B?dVZvbGY5QWVFekhlUG5oTG1PZ0NIeGhtaEFNVEwzbW5vZzI4RHk3UnNaMWhu?= =?utf-8?B?L0Q4NXZ1eUJyMy9uVUpZeFEzNU85ZDhGMUxSSWVHemdTODdUckFFTEE5SnBa?= =?utf-8?B?b0sxWVJZVkx1djhyRWJuV21hM21CZjhXN3hzVGNlbVNxV2R3azlySFZLMUh0?= =?utf-8?B?YStrYjhQL1diaGxHbzVXMzhmRjQwYlBnbHo4Y25kcHlYM2t4VFBDMWZ2Ri9D?= =?utf-8?B?OEcxcFBzNy9oa1p3RW40MmlsWEJkK29ob2ZtdUZWNUVNSGRhdVptNlR0REN0?= =?utf-8?B?dE1aclhMcTA0SmpUMDZmdGZPRGx0eDRFeEFNTGVNTm5rUXFhMm9DQUkrMTF1?= =?utf-8?Q?oYWroOXl+LMVYvR13r1NFHZXV?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa2d6450-347f-4696-c140-08dc4357ac89 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 12:18:21.7496 (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: 3hgJncznTtPlCUDJqHhTr5TB65rE98llBvdBAvJhDQWzZ7H7NOjHkecPwA9LDyL5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8424 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 3/13/2024 11:10 AM, David Marchand wrote: > On Wed, Mar 13, 2024 at 11:52 AM Ferruh Yigit wrote: >> >> On 3/13/2024 7:37 AM, David Marchand wrote: >>> On Tue, Mar 12, 2024 at 5:59 PM Ferruh Yigit wrote: >>>> >>>> On 3/8/2024 2:48 PM, David Marchand wrote: >>>>> Checking the number of rxq/txq in the middle of option parsing is >>>>> confusing. Move the check where nb_rxq / nb_txq are modified. >>>>> >>>>> Signed-off-by: David Marchand >>>>> --- >>>>> app/test-pmd/parameters.c | 8 ++++---- >>>>> 1 file changed, 4 insertions(+), 4 deletions(-) >>>>> >>>>> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c >>>>> index 8c21744009..271f0c995a 100644 >>>>> --- a/app/test-pmd/parameters.c >>>>> +++ b/app/test-pmd/parameters.c >>>>> @@ -1063,6 +1063,8 @@ launch_args_parse(int argc, char** argv) >>>>> rte_exit(EXIT_FAILURE, "rxq %d invalid - must be" >>>>> " >= 0 && <= %u\n", n, >>>>> get_allowed_max_nb_rxq(&pid)); >>>>> + if (!nb_rxq && !nb_txq) >>>>> + rte_exit(EXIT_FAILURE, "Either rx or tx queues should be non-zero\n"); >>>>> } >>>>> if (!strcmp(lgopts[opt_idx].name, "txq")) { >>>>> n = atoi(optarg); >>>>> @@ -1072,6 +1074,8 @@ launch_args_parse(int argc, char** argv) >>>>> rte_exit(EXIT_FAILURE, "txq %d invalid - must be" >>>>> " >= 0 && <= %u\n", n, >>>>> get_allowed_max_nb_txq(&pid)); >>>>> + if (!nb_rxq && !nb_txq) >>>>> + rte_exit(EXIT_FAILURE, "Either rx or tx queues should be non-zero\n"); >>>>> } >>>>> if (!strcmp(lgopts[opt_idx].name, "hairpinq")) { >>>>> n = atoi(optarg); >>>>> @@ -1098,10 +1102,6 @@ launch_args_parse(int argc, char** argv) >>>>> n + nb_rxq, >>>>> get_allowed_max_nb_rxq(&pid)); >>>>> } >>>>> - if (!nb_rxq && !nb_txq) { >>>>> - rte_exit(EXIT_FAILURE, "Either rx or tx queues should " >>>>> - "be non-zero\n"); >>>>> - } >>>>> if (!strcmp(lgopts[opt_idx].name, "hairpin-mode")) { >>>>> char *end = NULL; >>>>> unsigned int n; >>>> >>>> There is already a runtime check for queues [1], perhaps we can remove >>>> it altogether from arg parse. >>> >>> Good catch. >>> >>> This other check comes after parsing args, so I suspect it is just dead code. >>> I guess I'll change it into a rte_exit(EXIT_FAILURE..). >>> Is this what you propose? >>> >> >> I think that check is the main check for nb_rxq and nb_txq. >> >> The one you removed is for the 'hairpinq' parameter, which is not a very >> common usecase. > > This check was present before hairpinq introduction. > https://git.dpdk.org/dpdk/commit/app/test-pmd/parameters.c?id=1c69df45f8c6b727c3b6a78e13f81225c090dde2 > > > This check in parsing args is hit when setting incorrect rxq / txq config. > This has nothing to do with hairpinq parsing. > Right. I misread the code. Probably check was just after rxq/txq parsing but 'hairpinq' parsing get in the way and left check in even more odd location. > $ build-mini/app/dpdk-testpmd -c 3 --no-huge -m 40 -a 0:0.0 --vdev > net_null1 --vdev net_null2 -- --no-mlockall --total-num-mbufs=2048 -ia > --rxq 0 --txq 0 > EAL: Detected CPU lcores: 16 > EAL: Detected NUMA nodes: 1 > EAL: Detected static linkage of DPDK > EAL: Multi-process socket /run/user/114840/dpdk/rte/mp_socket > EAL: Selected IOVA mode 'VA' > TELEMETRY: No legacy callbacks, legacy socket not created > Interactive-mode selected > Auto-start selected > EAL: Error - exiting with code: 1 > Cause: Either rx or tx queues should be non-zero > Port 0 is closed > Port 1 is closed > > > >> But nb_rxq and nb_txq requirement is very common and it is protected in >> the main after parameter parsing. > > Sorry, I am not following. > >> >> I am not suggesting adding 'rte_exit()' for that case, probably it will >> fail in some other part and error log can provide the required hint. >> And I am worried if it breaks some unexpected usecase with exit. > > If we simply remove this check as you suggest: > $ build-mini/app/dpdk-testpmd -c 3 --no-huge -m 40 -a 0:0.0 --vdev > net_null1 --vdev net_null2 -- --no-mlockall --total-num-mbufs=2048 -ia > --rxq 0 --txq 0 > EAL: Detected CPU lcores: 16 > EAL: Detected NUMA nodes: 1 > EAL: Detected static linkage of DPDK > EAL: Multi-process socket /run/user/114840/dpdk/rte/mp_socket > EAL: Selected IOVA mode 'VA' > TELEMETRY: No legacy callbacks, legacy socket not created > Interactive-mode selected > Auto-start selected > Warning: Either rx or tx queues should be non-zero > ^^^ > Pointless log. > > testpmd: create a new mbuf pool : n=2048, size=2176, socket=0 > testpmd: preferred mempool ops selected: ring_mp_mc > Fail: Cannot allocate fwd streams as number of queues is 0 > Segmentation fault (core dumped) > ^^^ > And crash. > > I was thinking check is only in the scope of hairpinq. In this case you are right, check in main is redundant. We can either - have this patch, plus remove the check in main() - or remove the check in parameter parsing and add 'rte_exit()' to the one in main. Both OK to me.