From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C71C4968 for ; Mon, 26 Jun 2017 15:16:05 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2017 06:16:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,395,1493708400"; d="scan'208";a="101571697" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga004.jf.intel.com with ESMTP; 26 Jun 2017 06:15:59 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.133]) by irsmsx110.ger.corp.intel.com ([169.254.15.126]) with mapi id 14.03.0319.002; Mon, 26 Jun 2017 14:12:07 +0100 From: "Dumitrescu, Cristian" To: "Piasecki, JacekX" , "dev@dpdk.org" CC: "Richardson, Bruce" , "Jain, Deepak K" , "Piasecki, JacekX" Thread-Topic: [dpdk-dev] [PATCH v2 1/7] cfgfile: remove EAL dependency Thread-Index: AQHS7mzvuqIQhUQHKUit182ib9rAH6I3Ho0w Date: Mon, 26 Jun 2017 13:12:07 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BA712A0@IRSMSX108.ger.corp.intel.com> References: <1496133037-3014-2-git-send-email-jacekx.piasecki@intel.com> <1498474759-102089-1-git-send-email-jacekx.piasecki@intel.com> <1498474759-102089-2-git-send-email-jacekx.piasecki@intel.com> In-Reply-To: <1498474759-102089-2-git-send-email-jacekx.piasecki@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmJiYmZiMDEtZDc0Zi00Yjg3LTg2YzgtN2U4MjM1NzIxNzNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjJhWnhUc1I2cDhxRHJzclVlNVhMNmtDZzVTMGlcL2V6cWFRVlh6Y2FIRlBZPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 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 v2 1/7] cfgfile: remove EAL dependency 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: Mon, 26 Jun 2017 13:16:06 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jacek Piasecki > Sent: Monday, June 26, 2017 11:59 AM > To: dev@dpdk.org > Cc: Richardson, Bruce ; Jain, Deepak K > ; Piasecki, JacekX > Subject: [dpdk-dev] [PATCH v2 1/7] cfgfile: remove EAL dependency >=20 > This patch removes the dependency to EAL in cfgfile library. >=20 > Signed-off-by: Jacek Piasecki > --- > lib/librte_cfgfile/Makefile | 1 + > lib/librte_cfgfile/rte_cfgfile.c | 29 +++++++++++++++++------------ > 2 files changed, 18 insertions(+), 12 deletions(-) >=20 > diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile > index 755ef11..0bee43e 100644 > --- a/lib/librte_cfgfile/Makefile > +++ b/lib/librte_cfgfile/Makefile > @@ -38,6 +38,7 @@ LIB =3D librte_cfgfile.a >=20 > CFLAGS +=3D -O3 > CFLAGS +=3D $(WERROR_FLAGS) > +CFLAGS +=3D -I$(SRCDIR)/../librte_eal/common/include >=20 > EXPORT_MAP :=3D rte_cfgfile_version.map >=20 > diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cf= gfile.c > index b54a523..c6ae3e3 100644 > --- a/lib/librte_cfgfile/rte_cfgfile.c > +++ b/lib/librte_cfgfile/rte_cfgfile.c > @@ -36,7 +36,6 @@ > #include > #include > #include > -#include >=20 > #include "rte_cfgfile.h" >=20 > @@ -258,19 +257,25 @@ rte_cfgfile_load_with_params(const char > *filename, int flags, >=20 > struct rte_cfgfile_section *sect =3D > cfg->sections[curr_section]; > - int n; > + > char *split[2] =3D {NULL}; > - n =3D rte_strsplit(buffer, sizeof(buffer), split, 2, '=3D'); > - if (flags & CFG_FLAG_EMPTY_VALUES) { > - if ((n < 1) || (n > 2)) { > - printf("Error at line %d - cannot split > string, n=3D%d\n", > - lineno, n); > - goto error1; > - } > + split[0] =3D buffer; > + split[1] =3D memchr(buffer, '=3D', len); > + > + /* when delimeter not found */ > + if (split[1] =3D=3D NULL) { > + printf("Error at line %d - cannot " > + "split string\n", lineno); > + goto error1; > } else { > - if (n !=3D 2) { > - printf("Error at line %d - cannot split > string, n=3D%d\n", > - lineno, n); > + /* when delimeter found */ > + *split[1] =3D '\0'; > + split[1]++; > + > + if (!(flags & CFG_FLAG_EMPTY_VALUES) && > + (*split[1] =3D=3D '\0')) { > + printf("Error at line %d - cannot " > + "split string\n", lineno); > goto error1; > } > } > -- > 2.7.4 Please separate the cfg file functionality from the eal functionality into = distinct patch sets.