From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 67CCC69C3 for ; Mon, 6 Mar 2017 15:10:57 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 06 Mar 2017 06:10:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,254,1484035200"; d="scan'208";a="232813191" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga004.fm.intel.com with ESMTP; 06 Mar 2017 06:10:55 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.142]) by irsmsx105.ger.corp.intel.com ([169.254.7.38]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 14:10:54 +0000 From: "Mcnamara, John" To: "Mcnamara, John" , Ravi Kerur , "dev@dpdk.org" CC: "Ananyev, Konstantin" , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [v4 2/3] LPM config file read option. Thread-Index: AQHSlel+CK7CS8/7yEmra1/I1sM0NqGH1EQQgAAGg2A= Date: Mon, 6 Mar 2017 14:10:54 +0000 Message-ID: References: <1488743225-25750-1-git-send-email-rkerur@gmail.com> <1488743225-25750-3-git-send-email-rkerur@gmail.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDA5MmQxY2YtZDBjYS00YzJmLTgzODktNWM3OGZjYjhkYTE4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlDUUc5cE9nK1BLcFowa2FIYmJPWERjUExSdFM2dU10Vko1WW9CQ09raWM9In0= 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] [v4 2/3] LPM config file read option. 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, 06 Mar 2017 14:10:57 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John > Sent: Monday, March 6, 2017 1:57 PM > To: Ravi Kerur ; dev@dpdk.org > Cc: Ananyev, Konstantin ; Richardson, Bruce > > Subject: Re: [dpdk-dev] [v4 2/3] LPM config file read option. >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ravi Kerur > > Sent: Sunday, March 5, 2017 7:47 PM > > To: dev@dpdk.org > > Cc: Ananyev, Konstantin ; Richardson, > > Bruce ; Ravi Kerur > > Subject: [dpdk-dev] [v4 2/3] LPM config file read option. > > > > ... > > + > > +#define IPV6_ADDR_LEN 16 > > +#define IPV6_ADDR_U16 (IPV6_ADDR_LEN / sizeof(uint16_t)) > > +#define IPV6_ADDR_U32 (IPV6_ADDR_LEN / sizeof(uint32_t)) > > + > > +#define GET_CB_FIELD(in, fd, base, lim, dlm) do { \ > > + unsigned long val; \ > > + char *end; \ > > + errno =3D 0; \ > > + val =3D strtoul((in), &end, (base)); \ > > + if (errno !=3D 0 || end[0] !=3D (dlm) || val > (lim)) \ > > + return -EINVAL; \ > > + (fd) =3D (typeof(fd))val; \ > > + (in) =3D end + 1; \ > > +} while (0) >=20 > Hi, >=20 > It is probably worth putting a comment before this macro to explain what > it does. Also, it isn't clear, to me, what CB stands for. Also, having a > return in the middle of the macro might be problematic if it is used in a > function with a different, or not, return value. >=20 Nevermind. I see that this macro was already there and you just moved it. So, it is not your problem. :-) John