From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9896B39EA for ; Thu, 29 Jun 2017 13:13:38 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2017 04:13:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,280,1496127600"; d="scan'208";a="105099241" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga002.jf.intel.com with ESMTP; 29 Jun 2017 04:13:35 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.211]) by IRSMSX104.ger.corp.intel.com ([169.254.5.26]) with mapi id 14.03.0319.002; Thu, 29 Jun 2017 12:13:34 +0100 From: "Van Haaren, Harry" To: 'Jerin Jacob' CC: "dev@dpdk.org" , "thomas@monjalon.net" , "Wiles, Keith" , "Richardson, Bruce" Thread-Topic: [PATCH 2/6] service cores: coremask parsing Thread-Index: AQHS7AAB1QUgKjEtlkq/M8awnMcB7qI3DKOAgAHRDsA= Date: Thu, 29 Jun 2017 11:13:34 +0000 Message-ID: References: <1498208779-166205-1-git-send-email-harry.van.haaren@intel.com> <1498208779-166205-2-git-send-email-harry.van.haaren@intel.com> <20170626124950.GB5612@jerin> In-Reply-To: <20170626124950.GB5612@jerin> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzJhNjdmZjQtMjM0Zi00OGFiLThlNGEtOWZhZDRmNjdkNDBkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNi41LjkuMyIsIlRydXN0ZWRMYWJlbEhhc2giOiJYQ0R1RHdvWTNNXC9MNkJQZmo5dU9xbStVXC94MjQxVURMUnhjdENCVDJJRFU9In0= x-ctpclassification: CTP_PUBLIC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/6] service cores: coremask parsing 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, 29 Jun 2017 11:13:39 -0000 > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > #include "eal_internal_cfg.h" > > #include "eal_options.h" > > @@ -61,6 +62,7 @@ const char > > eal_short_options[] =3D > > "b:" /* pci-blacklist */ > > "c:" /* coremask */ > > + "s:" /* service coremask */ > > "d:" /* driver */ > > "h" /* help */ > > "l:" /* corelist */ >=20 > Good to have a corelist variant for service lcore list. May be for future= . Yep agreed. > > @@ -267,6 +269,75 @@ static int xdigit2val(unsigned char c) > > } > > > > static int > > +eal_parse_service_coremask(const char *coremask) > > +{ > > + struct rte_config *cfg =3D rte_eal_get_configuration(); > > + int i, j, idx =3D 0; > > + unsigned count =3D 0; > > + char c; > > + int val; > > + > > + if (coremask =3D=3D NULL) > > + return -1; > > + /* Remove all blank characters ahead and after . > > + * Remove 0x/0X if exists. > > + */ > > + while (isblank(*coremask)) > > + coremask++; > > + if (coremask[0] =3D=3D '0' && ((coremask[1] =3D=3D 'x') > > + || (coremask[1] =3D=3D 'X'))) > > + coremask +=3D 2; > > + i =3D strlen(coremask); > > + while ((i > 0) && isblank(coremask[i - 1])) > > + i--; > > + > > + if (i =3D=3D 0) > > + return -1; > > + > > + printf("\n\nRemoving Service Cores from lcore roles now\n\n"); >=20 > s/printf/RTE_LOG Removed. > > + /* TODO: only scan active cores in coremask */ > > + for (i =3D i - 1; i >=3D 0 && idx < RTE_MAX_LCORE; i--) { > > + c =3D coremask[i]; > > + if (isxdigit(c) =3D=3D 0) { > > + /* invalid characters */ > > + return -1; > > + } > > + val =3D xdigit2val(c); > > + for (j =3D 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE; > > + j++, idx++) { > > + if ((1 << j) & val) { > > + /* TODO: enable flexible master core */ > > + if (idx =3D=3D 0) > > + continue; > > + > > + if (!lcore_config[idx].detected) { > > + RTE_LOG(ERR, EAL, > > + "lcore %u unavailable\n", idx); > > + return -1; > > + } > > + //cfg->lcore_role[idx] =3D ROLE_SERVICE; >=20 > remove commented code. Doh - thanks.