From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C44C81B011; Thu, 22 Feb 2018 11:11:16 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2018 02:11:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,377,1515484800"; d="scan'208";a="19956985" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga008.jf.intel.com with ESMTP; 22 Feb 2018 02:11:14 -0800 Received: from irsmsx107.ger.corp.intel.com ([169.254.10.46]) by IRSMSX102.ger.corp.intel.com ([169.254.2.10]) with mapi id 14.03.0319.002; Thu, 22 Feb 2018 10:10:01 +0000 From: "O Mahony, Billy" To: "Richardson, Bruce" , "Kovacevic, Marko" CC: "dev@dpdk.org" , "Burakov, Anatoly" , "Varghese, Vipin" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] eal: add error check for core options Thread-Index: AQHTnDVqcLbhJOadtUuJ1lVrHQ718qORPdSAgB8SY6A= Date: Thu, 22 Feb 2018 10:10:00 +0000 Message-ID: <03135AEA779D444E90975C2703F148DC58C93237@IRSMSX107.ger.corp.intel.com> References: <20180201170732.3225-1-marko.kovacevic@intel.com> <20180202145128.6331-1-marko.kovacevic@intel.com> <20180202153306.GA7932@bricha3-MOBL3.ger.corp.intel.com> In-Reply-To: <20180202153306.GA7932@bricha3-MOBL3.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTkxMWUyZDEtNmQ4Yy00NzE1LWIzYjQtMGFlZjlhYjBlZTEyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImZHVDZiWGc0TVhMMW5qbWFVN2dwenFoQlJ3UFlQRnFZZk1Ocm5XbUpOVlE9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] eal: add error check for core options 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: , X-List-Received-Date: Thu, 22 Feb 2018 10:11:18 -0000 > > +.. Note:: > > + At a given instance only one core option ``--lcores``, ``-l`` or `= `-c`` can be > used. > > + > > + Hi Marko, I always found the n different way to specify cores perplexing. I always su= spected they were mutually exclusive but that was far from clear from the d= ocs and it never was important enough to me to try out the various options.= Taking the time to add clear documentation makes everyone's work more effi= cient and less frustrating.=20 So thank you and keep up the good work :) Billy.=20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Friday, February 2, 2018 3:33 PM > To: Kovacevic, Marko > Cc: dev@dpdk.org; Burakov, Anatoly ; Varghese, > Vipin ; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3] eal: add error check for core options >=20 > On Fri, Feb 02, 2018 at 02:51:28PM +0000, Marko Kovacevic wrote: > > Error information on current core usage list, mask or map were > > incomplete. Added states to differentiate core usage and to inform > > user. > > > > Signed-off-by: Marko Kovacevic > > Reviewed-by: Anatoly Burakov > Acked-by: Bruce Richardson >=20 > This is fine as-is - one comment below for future consideration. > > > > --- > > > > V3: > > - Changed to reflect the coding guidelines - Bruce > > - update the documentation for better clarity - Bruce > > - Added back the reviewer information - Anatoly > > > > V2: > > - Cleaned up the logging for error cases - Anatoly > > --- > > doc/guides/testpmd_app_ug/run_app.rst | 4 ++++ > > lib/librte_eal/common/eal_common_options.c | 36 > > +++++++++++++++++++++++++++--- > > 2 files changed, 37 insertions(+), 3 deletions(-) > > > > diff --git a/doc/guides/testpmd_app_ug/run_app.rst > > b/doc/guides/testpmd_app_ug/run_app.rst > > index 46da1df..85e725f 100644 > > --- a/doc/guides/testpmd_app_ug/run_app.rst > > +++ b/doc/guides/testpmd_app_ug/run_app.rst > > @@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more > information on these options. > > The grouping ``()`` can be omitted for single element group. > > The ``@`` can be omitted if cpus and lcores have the same value. > > > > +.. Note:: > > + At a given instance only one core option ``--lcores``, ``-l`` or `= `-c`` can be > used. > > + > > + > > * ``--master-lcore ID`` > > > > Core ID that is used as master. > > diff --git a/lib/librte_eal/common/eal_common_options.c > > b/lib/librte_eal/common/eal_common_options.c > > index b6d2762..66f0868 100644 > > --- a/lib/librte_eal/common/eal_common_options.c > > +++ b/lib/librte_eal/common/eal_common_options.c > > @@ -57,6 +57,9 @@ > > #include "eal_filesystem.h" > > > > #define BITS_PER_HEX 4 > > +#define LCORE_OPT_LST 1 > > +#define LCORE_OPT_MSK 2 > > +#define LCORE_OPT_MAP 3 > > > > const char > > eal_short_options[] =3D > > @@ -1028,7 +1031,16 @@ eal_parse_common_option(int opt, const char > *optarg, > > RTE_LOG(ERR, EAL, "invalid coremask\n"); > > return -1; > > } > > - core_parsed =3D 1; > > + > > + if (core_parsed) { > > + RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) > is set!\n", > > + (core_parsed =3D=3D LCORE_OPT_LST) ? "-l" : > > + (core_parsed =3D=3D LCORE_OPT_MAP) ? "--lcore" : > > + "-c"); >=20 > This block is repeated in slightly different forms 3 times. It should pro= bably be > replaced using a function or macro to return the appropriate string based= on > core_parsed value. >=20 > Thanks, > /Bruce