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 6A6F043686; Mon, 11 Dec 2023 13:02:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 529B640E0F; Mon, 11 Dec 2023 13:02:26 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 71975402E9 for ; Mon, 11 Dec 2023 13:02:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702296144; x=1733832144; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=P+uzKc/5UejmqDMQqQ1tn1fVw9dz0xeQQwxwzLCYTFI=; b=EKek3utImwlNyS8L+a15l1N1ldXSKqUS7ockNS73Slb/+2BBu9O/omm0 Vkf70Wx/ujLdFIkAQgbSwg6rtFZuIAEVxVNWgl2AWPPqs1e8T2KIUhsSm fmIGoerTcnncj3BrHqVFV/6FCJR6YKs3UVqZNb5lb4bNBSheLOO0kIfyx ZwNOtwIufvc9kefKI0QoSJ5Fk7Jc2jq7IwnSYfFkTmkbAP4PI5OWgHLbs Ocxng9panxO+470nw9ZvJZEI9gfQS2Q3ih+blOcxav4r1i3b7kMxIZY9n yF0ob83VEq6ENEPILRcW+WM4jg/RheKY7ex0bTCWOKoGUXy1enCQ6ifqy A==; X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="397426248" X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="397426248" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 04:02:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,267,1695711600"; d="scan'208";a="14420441" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 11 Dec 2023 04:02:07 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 04:02:06 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 11 Dec 2023 04:02:06 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 11 Dec 2023 04:02:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bd1iZTPWTZs9/vgCqjIMQWMDv4stWF84ZKdapHVUU/8uQybIOA1WMQ05NCv/hq4WAeJnFGRwo8tpP6h9TuE3QhT+FC8OHpxNKqCvDpVid7XEu04p5VhM3qGCIc7UKZ89369S11cv3FU7vs/vegt/M7xMNFZux7i72Avgj8/9z2cb07E4mVlfAZhwauWoIeHvnV1aKFUhQaPotzY5nz/aK5PHhUkztFherVAVooBTH6bt7ZjxiW4LFLGV29OvTvUXYmbOoT8RpbrKoMYkp8qLYbBsJRPybPq2or2GwpA6SJfa5rR+s7nBajapgxK8Voq7nuu3ccYCNkxcESfehwZM1Q== 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=0Ja5Ju/2rj1uGUfOotOXMrmOAywvjyIThqE55LJDgI4=; b=nElDPee8l1jtNjZAn2ItWqpKUP0vk1bwxD2Dh4eSBapIegOujaOlRX29c897YN+o/7FvcZ2S3EteKt5HClziOwPM+2AUQAOjno/AkXXKkDmwngoZe2q2YnEZRmKts0OrEeYzBJx1tSk5qowpNwsNis/S7UGhn51lPRLPHWTqW2GbFPNO+8ZOYPHXzvKbKZLNR7EYZaiHh6QbjDs8i0xPEw1vs7hmQGla8qQkM22zRTCuE7hFUjI2NbBS/QxcKfmW6YFoRqy/eVLyGfaV6OeXIDhcB7uukzfSe0Tn2KETmQDsag6ssd9gTVQNFA/j6+qNFp1X1GF9rv6Qs3tnF4xHaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by SA1PR11MB6941.namprd11.prod.outlook.com (2603:10b6:806:2bd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 12:02:01 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::497b:f87f:c185:41b9]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::497b:f87f:c185:41b9%4]) with mapi id 15.20.7068.031; Mon, 11 Dec 2023 12:02:01 +0000 Message-ID: Date: Mon, 11 Dec 2023 12:01:54 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 8/8] examples/l3fwd-power: update to call arg parser API To: Euan Bourke , CC: Anatoly Burakov , Sivaprasad Tummala References: <20231207161818.2590661-1-euan.bourke@intel.com> <20231207161818.2590661-9-euan.bourke@intel.com> Content-Language: en-US From: "Hunt, David" In-Reply-To: <20231207161818.2590661-9-euan.bourke@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU7PR01CA0004.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::18) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3799:EE_|SA1PR11MB6941:EE_ X-MS-Office365-Filtering-Correlation-Id: b92b7adf-3a56-49aa-80f4-08dbfa40facd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6pOTgi8p++Bgz7Q3tLsJicS8U5UXty9kjUmNqlFdoNBsJk68BLNgx4+RWAObV7QKohlNrn04rW7slhsguBj1luChVf7zg2QiwY7fTCeVRsmPCKGQzQtHOQ1ONYG5IBwgDy/PdgigyjyAu2nCrmNbIjQfknyU7cBN6BK2Ncqjp9xyFN7AH9OfhIuAPQEMgK1ann4csqvUi3YHXdAIpMX4sRqEEfysfXRk9EQBjAfYnCIW+ldb+V5Uh3fyHHaMxuzKmPsAoZTdgg0WsHIbZN+v5m7KXAJyt26lvEZ73eQR+tdQHB+WI22fk5CpyXnaJ31HtPYe039PC6Yeb9M3HAyBAKMkvncoeJIuIskBSCwCEVNao+xlts3Xx/15B+LvkCMYd5UIcXGLSERaxm6bg83ju0MKJ/7c7Eaao/cQsreZ9pwTmgyXsO3mh+odrqDPmGy+riQZ4nfcahmQibE9vFZzlL79GyxuHJBXacMgdQO5JP4QVNKEuOMPeh1R7AjroXEZFztGjZAbURVpueKslR6olwfm0fMLjqrDZAb82ViZ6/cUOHsA1+OgkUvCMyhJP+G5WtRalUKHihe67MlrOjBsZuEUqtsXQ2zkBKjIt7EYErVv3uB2kjEBsnATmU2nUpApAGms8BmbCsn1FYF1FAi1pA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(31686004)(26005)(2616005)(82960400001)(38100700002)(86362001)(31696002)(36756003)(66556008)(83380400001)(5660300002)(15650500001)(6512007)(53546011)(6506007)(6666004)(8936002)(8676002)(66946007)(6486002)(54906003)(66476007)(316002)(2906002)(41300700001)(478600001)(4326008)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cmQxV3BVWWFOWk5ycjRGMlJxeDlpVFFYdkxZMVpJOUtoY2tBU2l4N1VEOW9Y?= =?utf-8?B?dGdJZUkvMnNGUEVBYmdoSVg2cW5mZTQxSFJEUmh2RFJZMTlyVkRsMzl2Vm03?= =?utf-8?B?NjkwUjMxQ05BWFZNSVNxVU12a08yUHRRclF3eUw2ZEhVVUhEaDk4aXp4THMz?= =?utf-8?B?RFFzTUZKTVAyY2pVL2o0bnQ5cTRjSXVMMjZ4cEx3RkV5ell2dUFqSzVxaC9V?= =?utf-8?B?cERsS3JoWUszUTYwUjhYRElSU001cEVSUzhnMjFhUENoUTJHVS9UZnIxTDRX?= =?utf-8?B?TCtZdmlWbTdnb25jbUY2V0hnZTFQenNoM3dQV2h5bWRwdXltN0xmNEZvWVky?= =?utf-8?B?d2hPTVJtdEZGN2NWSmt0RWNiODkzUXcrakN0N1N2cFc3cTVJaHlVSTVTbnlq?= =?utf-8?B?cG5yUXhDNDZwYm5udUhXZzFWVHJHcE15dmxlVVRGK3ZPaFJmRXRJQjdHd2Yv?= =?utf-8?B?cXFGM0lpUkMweWx5dkJpQnpQTmlWd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QjZoSi94aDBZRUIySlhqMWdLcGFmRysyQXZFd05MUUJPQXhJbmta?= =?utf-8?B?Z0xrWXFMMTlFcG54QllSSjAxVHljOWdwcWhTb2ZTaHRhbnFIZTR5UXM3RUo4?= =?utf-8?B?bHhqeklKNllSNVRvYXNSWm5qRWhlNTA5eThYVGtqdjQxRURReDNKVnA0ZXlT?= =?utf-8?B?S25iYS9pZUZRNDZTTkJqYWdSd0xxcWMzWm9HVWNZR3BZUFMyVXJBaGdwRks4?= =?utf-8?B?bTFxY2s3bW9pWk9YNVhOZnl0ZWk2N3Z4b0RQckpaalNJenJiWWxOY2pBR3VT?= =?utf-8?B?N1JvLzZHV3JnUjA1TW5YM0xCb0lRWVdONm9VcDIvTlJVaEx6MnNjT01ERDJs?= =?utf-8?B?dnhPYWxoajlBWHFqdXJwYzE4NGErZ21Wa1dnWUFaT09HYndHNk1oWDFSOW1r?= =?utf-8?B?RDhzajJCRkxHbFZ2RTNUK055WjFWTkhYMmFEcjk0dUYyYjA0bmF6elg4MUNU?= =?utf-8?B?aVU3MVN4STZCN094OUpEOWFtM0cvV3dRbW92eGs5ejgvaVExUXpnOVM4T3Rp?= =?utf-8?B?TTFwa01tdWpEaHN5b0JHTCsvWENzVUdhR05SNWsrV2xwL25ZaFYvdll4WWxq?= =?utf-8?B?ZXZiTFIrTnJ6WUI3VzZFMXduZU90V2NZNnhJbWtYMjV0WWhYOG9DeWVVVGRV?= =?utf-8?B?Zk5WaWJIeUhyR0xmYnp0ZXBuWFNsd0hkNjVJbEs0c2JQU0c1Mkp3TXJkTmJZ?= =?utf-8?Q?RiUCQxGfoTlsYdnMX0PH8DIsW?= X-MS-Exchange-CrossTenant-Network-Message-Id: b92b7adf-3a56-49aa-80f4-08dbfa40facd X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 12:02:00.6515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RH3yPJX7AyR8EDfgfT7Gto39IbZcJmlZHoaYVeeFlyuTnoddNWhStG+QI4xs3y8CclnS0bSj3Czfvfk81F0+sQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6941 X-OriginatorOrg: intel.com 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 Hi Euan, On 07/12/2023 16:18, Euan Bourke wrote: > Update to the l3fwd-power example application to call the arg parser > library for its 'combined core string parser' instead of implementing its > own corelist parser. The default_type passed into the function call is > a corelist. > > Signed-off-by: Euan Bourke > --- > examples/l3fwd-power/perf_core.c | 51 +++++--------------------------- > 1 file changed, 8 insertions(+), 43 deletions(-) > > diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf_core.c > index 41ef6d0c9a..f8511e30b3 100644 > --- a/examples/l3fwd-power/perf_core.c > +++ b/examples/l3fwd-power/perf_core.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > > #include "perf_core.h" > #include "main.h" > @@ -177,56 +178,20 @@ parse_perf_config(const char *q_arg) > int > parse_perf_core_list(const char *corelist) > { > - int i, idx = 0; > - unsigned int count = 0; > - char *end = NULL; > - int min, max; > + int count; > + uint16_t cores[RTE_MAX_LCORE]; > > if (corelist == NULL) { > printf("invalid core list\n"); > return -1; > } > > + count = rte_arg_parse_core_string(corelist, cores, RTE_DIM(cores), 1); > > - /* Remove all blank characters ahead and after */ > - while (isblank(*corelist)) > - corelist++; > - i = strlen(corelist); > - while ((i > 0) && isblank(corelist[i - 1])) > - i--; > + for (int i = 0; i < count; i++) nit: you've used int here, but below you use uint16_t for a for loop. If you're re-spinning, it might be worth making consistent. But no biggie. --snip-- > @@ -234,7 +199,7 @@ parse_perf_core_list(const char *corelist) > nb_hp_lcores = count; > > printf("Configured %d high performance cores\n", nb_hp_lcores); > - for (i = 0; i < nb_hp_lcores; i++) > + for (uint16_t i = 0; i < nb_hp_lcores; i++) > printf("\tHigh performance core %d %d\n", > i, hp_lcores[i]); > I've also tested this with a 16-core incantation of l3fwd-power with various combinations of cores, seems to work well. Acked-by: David Hunt