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 D628143725; Mon, 18 Dec 2023 04:14:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 659A840282; Mon, 18 Dec 2023 04:14:15 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2085.outbound.protection.outlook.com [40.107.220.85]) by mails.dpdk.org (Postfix) with ESMTP id 4748240269 for ; Mon, 18 Dec 2023 04:14:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgTbjuIbhBRWxpw9/1VGjBaf1eML8eYTalGiR18Px11VMFzb/ca34fZp6MgkbL5m77CEANFZkm8fj1RPDLdXNCtl2GApkSwn9EgQyjerdCYvLkk8t/TWDxrGHsrBpS3Ta1KyRRg4582PJclOEC85Jrro48Wqsx9jKb6z+3PHGnActW2qqHy890noLJ1cgI0zWlCuu7NYylt7W80f7UIzuTvIHG+WRaIYpuELGsiChe/t6y2wE2Gcrxapsz6UihnY8oDh4zrJHE5lyOwpd2reiKzeR2t3f2EF/J+FKulhk+jgfPxALR2vqESlchLgqSosWv8HkLkWpC92AKhGneugQQ== 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=hsCgQJNRbrxrEIlJCj1Arn8/3D0gXaepmI0gyUNowSk=; b=OKSAmjfglPRK6O+OQ4zXSygkvTVe02qJNBB0IOSpilh+umzG7D4UiLU0KhDCahLwLBOG8tqlSNP6GCG2QpAC/QUMHNb/XuIK7rnwsxZHjU0uP9kkkSdCsmoQ68rhxjJ07xZmRdV9ie2dhYgN+X/02SPYYJ+byhdZlsxoDj+tmHljhXFO20j3LO484Zi392BVGoCQM5y9PajOIK6yLzwLKaxQ1DGoYyL2PdIkvUivzpjTkoRhC77uuG2oukukA4UxYqWdfKJz1vXP290EevNh1SBwBz32I7Vi5A+itdihf519WUdbWoYlpVgBzabwU5P9HMTgXyDS0hRV98ux22QA6Q== 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=hsCgQJNRbrxrEIlJCj1Arn8/3D0gXaepmI0gyUNowSk=; b=Uj6M5H3GK/V8Mi61inxTKF4IQBh0BlW5e8KIYJyKq5R/9vi/JLW0VEoKpke9XKN5O4d6qaiqf/J7jrJ7+J+2KQgAoC7PY85zKOHhP4W19XgVnJJhjU1GgqtSOn7mNRE7G7KpTbH9Uln9qmry0y3DbDACZHv0+o6vi3OYPZ7TMxw= Received: from DM3PR12MB9286.namprd12.prod.outlook.com (2603:10b6:8:1ae::6) by CH3PR12MB9394.namprd12.prod.outlook.com (2603:10b6:610:1cf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 03:14:11 +0000 Received: from DM3PR12MB9286.namprd12.prod.outlook.com ([fe80::2f17:4c1d:b750:cc44]) by DM3PR12MB9286.namprd12.prod.outlook.com ([fe80::2f17:4c1d:b750:cc44%4]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 03:14:11 +0000 From: "Tummala, Sivaprasad" To: Euan Bourke , "dev@dpdk.org" CC: David Hunt , Anatoly Burakov Subject: RE: [PATCH v4 8/8] examples/l3fwd-power: update to call arg parser API Thread-Topic: [PATCH v4 8/8] examples/l3fwd-power: update to call arg parser API Thread-Index: AQHaL3vw0NHIiMssj0Oe7fnD3PYzqrCuYSfQ Date: Mon, 18 Dec 2023 03:14:11 +0000 Message-ID: References: <20231215172632.3102502-1-euan.bourke@intel.com> <20231215172632.3102502-9-euan.bourke@intel.com> In-Reply-To: <20231215172632.3102502-9-euan.bourke@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=4c68b4de-d9cb-4359-bda6-ea59e1f3ad20; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-12-18T03:12:41Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM3PR12MB9286:EE_|CH3PR12MB9394:EE_ x-ms-office365-filtering-correlation-id: 567214b5-f9c7-4ed2-74b0-08dbff776812 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ac6q9srOtVa4bAsRNfGfTM1ikRHi3cDMgoOQcIwzkYp6NDPdrFEf/AVm+GngKCEB0p/jGUBj1lKbrOT3vZxz97IwBU3V9uBELD7AmYyGX3kIM1Z4nnogUX4SBS00Nx+ZxR1ZaLmcV6g3G4AafTRvASh6KsXeUOLppzy2P8ppeuZ7m6/ob1GthUWS6VS/zXHN3atdHjjNb/i3E0ZAqB9qUwDS0pyiOsAIWukaTwb+3p0P6J66sz00Ibc5vP3iqHk5v5NLGqMQLRkorIMkrq2XyaniP6WIHD29d2dDW8hSvtmDoamF+fOqJEex8+3Izc1dE0Ys1jEe91Kn4iP33Io9xx8ilh+GmMq5LGNlrIX6VJeUQO9/gJjNqoJBSynY4pj3GTu07+H4GkhNSe5MCsHKzRwKySdurkWkCdN0btpnWsy/cqU4n8KDAKvucotx+Uu6qFPR/yuCYfpev5ZVhPJwUeN4wcXiYEPqwhvt5mJHoDazwx1ZKSdS4Z/R2j43//43PzPg4a5/mlxC+2FoLt3WXp1olBx9eijL/0GiNCuM1ch7B8OU6AL0MYhyVriFhhAY05PjIFTn+jhf7hI41EZ5fANf5IMPBbLwPYhJMjVsZpWYrN4OwbUgnn1sEu9Eue71QqZkccK0+PLchm7mIDcv1KCqITGxBbVOAupa5/01p78= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM3PR12MB9286.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(136003)(346002)(39860400002)(376002)(230273577357003)(230922051799003)(230173577357003)(1800799012)(64100799003)(451199024)(186009)(38070700009)(316002)(83380400001)(66556008)(55016003)(76116006)(66446008)(110136005)(66476007)(66946007)(54906003)(64756008)(122000001)(15650500001)(2906002)(52536014)(8676002)(8936002)(4326008)(5660300002)(71200400001)(53546011)(7696005)(9686003)(38100700002)(26005)(478600001)(86362001)(41300700001)(6506007)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?MqEbG6mFMBaS+oHslIBqpdtHswU11E5UDYkXMeKWB/0a5PoaFZOnqa/Aahng?= =?us-ascii?Q?DAZ8R/F2WOVks1ylHLAz1zBd8oHhLhBtXyG3qAN5nQYnZ+wZu2e9/TOIEyDb?= =?us-ascii?Q?TTtXnaDQeVJPhWJ5J7aGYaZaBurh+A9VHusYhGqmftkjyZU85L46IqC4oGXT?= =?us-ascii?Q?MWAIpozHPm1268vPE2JIl7POnbA18OsIF3Lj4vTZlZ1J2pjgbpERY+hdZsuX?= =?us-ascii?Q?Dp6PDc+q90ean4vhfUml1hpcb5xBpE0pltMMshjOuRE5lWcuYp1zqYqOJmSt?= =?us-ascii?Q?WG1mfcGce9uWz7rTptwwGmD2udwipfPo2RrKaZKHTLdiYY1R0xG5BB4bfEOO?= =?us-ascii?Q?+DF2OYWSii214yfkCzQIyNSgQTmRRdeXEjSWoypOSdZaNMbucvN05ancyb30?= =?us-ascii?Q?eHXkvETBTUR/AYTScy9Vt/77r+uhmQpAlHXGKFDm3aK4LA1bY7XX1Ot9JNGL?= =?us-ascii?Q?2h6NhzGfvtUUMByo8r2mmdTWODNda8zTasVFnv87jbxpN+KxvqSVYbeaNbvh?= =?us-ascii?Q?2fM54Pb1EwHkfH5nAcVzMoanbWm9HD33Nt0SM+H9xl4L0u+UklxcTjG+VPBt?= =?us-ascii?Q?OfqAiOTBKMRizk4z9w1tl91zcGRhgjYxY0DluqjCschKS/C7xjUAtUAfsIXD?= =?us-ascii?Q?x6NDzE+ik5JVd9Izuaq92f7GMt6IW6GSTwJSqIB//6xrK+BIq+Xt0q98WA+i?= =?us-ascii?Q?bEazh0r50yl/2Pq3hbTObPps+/41GXY8/V4Uhs/7iZGL4BqVM4LO6BuSCKM4?= =?us-ascii?Q?CMcS8GUD4u/dGIN7zqRjQQQMVka2Txp2QHJSKQuE41OH+YieMF0Jcaoi9QMx?= =?us-ascii?Q?AVg0jstYlAR27ENqddtEdYSlar673E+abUlvNWPHrt19Qf29RkwfdmpIMrWb?= =?us-ascii?Q?nBr6G7dyVC0mwBlnQ+rcl6ejLlh7FtdwQaBoVldld1EkZS1ep7svfkV4igGK?= =?us-ascii?Q?1ViEnn739P7LRV3V6znaScOePkB2wH66kB/CxAKZkNYSXszU24g5zUMGXaGS?= =?us-ascii?Q?5AJWGU/KTf85Zi8qnxmG78LNNDX5vLAEj0lFq3LvHhMN/vw4jqNoG/fFW/fY?= =?us-ascii?Q?btLwipJzgRZi2AsSYc/NwE96jPYREhm08GJT87p1t08kjZTBwUIIp5ErCeJK?= =?us-ascii?Q?XfiXZrX55khLsbuoq2oDD0VTOOBbwoRLWgYI21vRpyf75dQ5IS0Ek4B9PAp5?= =?us-ascii?Q?/xP4OWWRVQ6iM3xYwGHO0G/gDD3zjR1lqTsryYhggo+KQ2Q5PdS0oAJOSJaD?= =?us-ascii?Q?UJNojsVnYi5Mv4my9tOksw15IAqqqPQb7MaQOfGQPaGFUfMmJMvkzJihMAWV?= =?us-ascii?Q?ekKt1hfRRsW2hyBdb9K23OzMtteppx92qwVtON1fFtiG1ndCMmuP2Z8xWTHJ?= =?us-ascii?Q?8IV9jGjE8EbtxgSdm/NOR4ePSg4QYtcWiXeMi4MdaJoyWbbiUxt6X3N+Hmrq?= =?us-ascii?Q?Pmp71u+mnDdX7hHwqAhPOUb/nrCSNQfR+VTpFMA/y1icnoVPGzsi87dqN0Jt?= =?us-ascii?Q?/aqFFhOs7ihuW+dmNPCfll7ST0WDt6HEA0rUh9RL2otNrxUeUOcbcqivvki0?= =?us-ascii?Q?Z2PaaHZGBeX16k5nNwY=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM3PR12MB9286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 567214b5-f9c7-4ed2-74b0-08dbff776812 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 03:14:11.4911 (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: uPWCBSeVnm1Djv6/w2xutKQOY9Uvr6CcLokt4mKABVNbY8FjlQg40Zi0gzneHfMZO6UgRIl+w6/75f1W4PStsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9394 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 [AMD Official Use Only - General] > -----Original Message----- > From: Euan Bourke > Sent: Friday, December 15, 2023 10:57 PM > To: dev@dpdk.org > Cc: Euan Bourke ; David Hunt ; > Anatoly Burakov ; Tummala, Sivaprasad > > Subject: [PATCH v4 8/8] examples/l3fwd-power: update to call arg parser A= PI > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Update to the l3fwd-power example application to call the arg parser libr= ary for its > 'combined core string parser' instead of implementing its own corelist pa= rser. The > default_type passed into the function call is a corelist. > > Signed-off-by: Euan Bourke > Acked-by: David Hunt > --- > examples/l3fwd-power/perf_core.c | 52 ++++++-------------------------- > 1 file changed, 9 insertions(+), 43 deletions(-) > > diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf= _core.c > index 41ef6d0c9a..e8ed414d40 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,21 @@ parse_perf_config(const char *q_arg) int > parse_perf_core_list(const char *corelist) { > - int i, idx =3D 0; > - unsigned int count =3D 0; > - char *end =3D NULL; > - int min, max; > + int count; > + uint16_t cores[RTE_MAX_LCORE]; > > if (corelist =3D=3D NULL) { > printf("invalid core list\n"); > return -1; > } > > + count =3D rte_arg_parse_core_string(corelist, cores, RTE_DIM(core= s), > + RTE_ARG_PARSE_TYPE_CORELIST); > > - /* Remove all blank characters ahead and after */ > - while (isblank(*corelist)) > - corelist++; > - i =3D strlen(corelist); > - while ((i > 0) && isblank(corelist[i - 1])) > - i--; > + for (int i =3D 0; i < count; i++) > + hp_lcores[i] =3D cores[i]; > > - /* Get list of cores */ > - min =3D RTE_MAX_LCORE; > - do { > - while (isblank(*corelist)) > - corelist++; > - if (*corelist =3D=3D '\0') > - return -1; > - errno =3D 0; > - idx =3D strtoul(corelist, &end, 10); > - if (errno || end =3D=3D NULL) > - return -1; > - while (isblank(*end)) > - end++; > - if (*end =3D=3D '-') { > - min =3D idx; > - } else if ((*end =3D=3D ',') || (*end =3D=3D '\0')) { > - max =3D idx; > - if (min =3D=3D RTE_MAX_LCORE) > - min =3D idx; > - for (idx =3D min; idx <=3D max; idx++) { > - hp_lcores[count] =3D idx; > - count++; > - } > - min =3D RTE_MAX_LCORE; > - } else { > - printf("invalid core list\n"); > - return -1; > - } > - corelist =3D end + 1; > - } while (*end !=3D '\0'); > - > - if (count =3D=3D 0) { > + if (count =3D=3D 0 || count =3D=3D -1) { > printf("invalid core list\n"); > return -1; > } > @@ -234,7 +200,7 @@ parse_perf_core_list(const char *corelist) > nb_hp_lcores =3D count; > > printf("Configured %d high performance cores\n", nb_hp_lcores); > - for (i =3D 0; i < nb_hp_lcores; i++) > + for (int i =3D 0; i < nb_hp_lcores; i++) > printf("\tHigh performance core %d %d\n", > i, hp_lcores[i]); > > -- > 2.34.1 Acked-by: Sivaprasad Tummala