From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5069CA0524; Fri, 31 Jan 2020 15:42:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 456151C0CC; Fri, 31 Jan 2020 15:42:21 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E4DF01C0C3 for ; Fri, 31 Jan 2020 15:42:19 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 06:42:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,386,1574150400"; d="scan'208";a="428731116" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga005.fm.intel.com with ESMTP; 31 Jan 2020 06:42:18 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 06:42:18 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 06:42:18 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/al0BRfFvtdLca9M9H/s7ZQExInPuiiTjW2dZYl9yfYF0DODylLwmosUazvx5t0qSinIVEv/KdwZZkC46ST1vf03XRi2xOwojtgKTjwB+yPMreoTo2EcVSG+NSLjqYrH+lZNcJ5H9ktbj7Id9wN++3rb+rUm9T8RMn1Gv5o8VhV0IP+kUBpVTfzhHZe1ejUHgkjo93uZXkbqN+7vrQaleM/Yj47I7B6TIbx9FOiOFV30G2nKEgKtiEwGN15lOEhJ/Nhbns4SPxFXrMwga//JIA/CRk2uaTs2PSrr+Ul2e+FvWSf3EGBgJMIg0dumTIGrdtpsXhWuxjWGwC1cffWTA== 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-SenderADCheck; bh=VEvP/RyemCsYHeJzUz6DaE6sl5ySJjYVR0Kpuo5fSkI=; b=OhKVBnoQmeOLNRqnok52BJVf8hbGUZfGuVQrgkCNl3Hzakv+VYLc9gDVDkgsdXvW9/YSfm88IZbPyT7nGxboxJOw9O6JjZE88cjZUE8fK3GX0n1o379ludohJW1RtyZA5oQ2BHJ4gFse6160+3ZUPnIX3rPXBR+aNu7Q10wf+3YhmYBBOYJrn9QM1+qV3OgULz60lX3FxiMObE9TIlNliaULYZpb6nt0tVsLXOk4iIbnB1K+hW3e1mTaxnYpR8V+XmAw9yyZJG1f2tgy75xTOCc1QGl9vhP4ry+ytWOwoMCLkIqDfBJFsekN3KmCTiesHwvmMADBvxXW2+7biUI91A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VEvP/RyemCsYHeJzUz6DaE6sl5ySJjYVR0Kpuo5fSkI=; b=b26gFWmQVt6YEzFNHW2qIyFDntxRa/wVxQiz8q2AbXhcaU0bAKSJYqq5EKxAx/eoZwEN/mes92sLNBCfX7JB69fc3OOmXAkxy/0Zo3H1rc7MSFHDV0i38wr5x+TWpjzOSjbsRS/lyXvpfJzMymx67muDCAyn70j3V2yzFnKrl7E= Received: from BYAPR11MB2648.namprd11.prod.outlook.com (52.135.227.138) by BYAPR11MB3286.namprd11.prod.outlook.com (20.177.127.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.27; Fri, 31 Jan 2020 14:42:16 +0000 Received: from BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::d0d2:ce29:adf5:f6a5]) by BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::d0d2:ce29:adf5:f6a5%7]) with mapi id 15.20.2686.028; Fri, 31 Jan 2020 14:42:16 +0000 From: "Govindharajan, Hariprasad" To: Stephen Hemminger , "Yigit, Ferruh" CC: David Marchand , Thomas Monjalon , dev Thread-Topic: [dpdk-dev] [PATCH 2/2] eal: add eal_parse_optionlist to parse user input Thread-Index: AQHV1Pz+gQkO02bgcUqui3kv9lbPTKgAWKUAgAGU9ICAAAZAgIAAFESAgALW2BA= Date: Fri, 31 Jan 2020 14:42:15 +0000 Message-ID: References: <1580121053-26083-1-git-send-email-hariprasad.govindharajan@intel.com> <1580121053-26083-3-git-send-email-hariprasad.govindharajan@intel.com> <1689bec2-91f3-77cd-8604-f7123023b109@intel.com> <6e50daed-d368-215b-22da-fc7332ded22c@intel.com> <20200129111937.031a16a6@hermes.lan> In-Reply-To: <20200129111937.031a16a6@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzEzZmU1YjMtNzgwMC00NDgxLWE0NjMtZGY0NWIxMmM4YzkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibDhETWd3WFFpZDAwVVc0SG5Wb0I4VFZQNnhhZ0NVUm84aUZWSE92c1dvdjdjZmU1ZTFZMjNRRkJ4TVBsT1dLVCJ9 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=hariprasad.govindharajan@intel.com; x-originating-ip: [192.198.151.190] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f8035cb5-aeef-480e-11b0-08d7a65bc44b x-ms-traffictypediagnostic: BYAPR11MB3286: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 029976C540 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39860400002)(366004)(376002)(396003)(346002)(199004)(189003)(2906002)(55016002)(186003)(71200400001)(26005)(86362001)(5660300002)(9686003)(52536014)(316002)(66556008)(66476007)(76116006)(66446008)(64756008)(66946007)(33656002)(6506007)(4326008)(6636002)(53546011)(478600001)(81156014)(8936002)(7696005)(110136005)(54906003)(81166006)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR11MB3286; H:BYAPR11MB2648.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7aHYUn0v8XvkQihtfpd1UFok/I6NGNhf4tikNyljYSO7pgnFEb7y9V1Z6UI7K7HA7v54wW8w1vzlz8mXq1cp/rKka1JD9xjVGQV91L91TboDx3MDRVCz5B3tr5WBxUqkrqhMa8RjFxpWBe0AZ2u3t1trFbucjFYJ1BQMlmSw8NKSgxg9z7uY4olvh3dunt3NCV6Qetgr8nh5AlT392OPLrBBldzDlgXK3uPgq2HnNJrWzYcrTo+Zj1o8s8Wh5BxGJ8p9kzXdgFTw6T9m7UK/I6j4x0Ges06HzB0LcUEiQiRKmPO9RVPXB3rfPstRNe/MU9LbdQTmftuMdVjhbm20XNAEX63WfiPzyh0cQXc2oTYEO1MQR8J+JrXnzNUisseeaLpEJ57V6VcDtO41ynpN7kwpp96E4ZYKXmupAP580sJls5TpC8vifHGs1BoHixh6 x-ms-exchange-antispam-messagedata: Lb0+f6+c/5f++a9r05FeYPJQojGs9OL/uujpo/vdGMHU7ZCtsQljiX5QWuK3cBoHa/KyG474/Hh2PAHTmo3fo/ChJo361LM4RykkAYILXeM3Xb/rwCRr0zTUHElF3tJXhcmvNxR9ADcbuzDfx74LVA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f8035cb5-aeef-480e-11b0-08d7a65bc44b X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2020 14:42:15.9734 (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: YiyY8uy5iB6JkutZUZV1kekDGYzFLx2CeKFdD1DET0GsCayC0SlsGSE/TsMqK3Qry6gkoMbPqAqlVveJGK/zHLdLY/OngtD/ZYykHACS2K5rrcrw+0aS2YfgXSUwcq/S X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3286 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/2] eal: add eal_parse_optionlist to parse user input X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Stephen Hemminger > Sent: Wednesday, January 29, 2020 7:20 PM > To: Yigit, Ferruh > Cc: David Marchand ; Thomas Monjalon > ; Govindharajan, Hariprasad > ; dev > Subject: Re: [dpdk-dev] [PATCH 2/2] eal: add eal_parse_optionlist to pars= e > user input >=20 > On Wed, 29 Jan 2020 18:07:05 +0000 > Ferruh Yigit wrote: >=20 > > On 1/29/2020 5:44 PM, David Marchand wrote: > > > On Tue, Jan 28, 2020 at 6:35 PM Ferruh Yigit > wrote: > > >> On 1/27/2020 10:30 AM, Hariprasad Govindharajan wrote: > > >>> In current version, there is a function which parses the corelist > > >>> based on user value. A new generic function eal_parse_optionlist > > >>> is added which will parse corelist as well as similar user input > > >>> so that we can use it as a public API too. > > >>> > > >>> Signed-off-by: Hariprasad Govindharajan > > >>> > > >> > > >> Hi David, > > >> > > >> Overall this patchset is to add '--portlist' command to testpmd and > > >> remove existing 64 port limitation. > > >> > > >> And in this patch re-uses the exiting parser function in eal and > > >> converts it to API, question is if eal is good place to have this AP= I, what > do you think about it? > > > > > > Exporting string parsers from the EAL has little value. > > > Ok we avoid code duplication (and I can see other places in the tree > > > where it might be used), but in the end we will have to maintain > > > this API in the ABI when it enters the stable ABI. > > > > > > I am for avoiding this. > > > > > > > > > > The same function can be used in some sample applications too (which > > are using port mask), so instead of duplicating it multiple times, it > > would be nice to have this function somewhere that applications can use= . > > > > Does it makes sense to have a rte_util.c (under in eal or as a > > separate library) to have this kind of application helper functions? >=20 > It makes sense to have a rte library that handles arbitrary size bitvecto= r and > has string handling functions. Kind of like what kernel has for the cpuse= t > parsing. This could be used for cpus in EAL and port-masks or other arra= ys in > applications. >=20 > But just doing copy/paste of existing code without thinking about how API > should work is a bad idea. [Govindharajan, Hariprasad]=20 Hi, PLEASE IGNORE MY PREVIOUS EMAIL. I am planning to move the existing parser function to the testpmd file inst= ead of keeping it in the eal and will revert the eal back. Also, I am planning to create an util file in eal with this parser and do a= RFC. @Stephen Hemminger, We already investigated the existing function and then = decided to re-use it as seen in the patch. For creating an API, is there an= y other specific requirements that should be addressed? Please clarify us. Thanks G Hariprasad