> -----Original Message----- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Mcnamara, John > Sent: Monday, March 6, 2017 1:57 PM > To: Ravi Kerur <rke...@gmail.com>; dev@dpdk.org > Cc: Ananyev, Konstantin <konstantin.anan...@intel.com>; Richardson, Bruce > <bruce.richard...@intel.com> > Subject: Re: [dpdk-dev] [v4 2/3] LPM config file read option. > > > > > -----Original Message----- > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Ravi Kerur > > Sent: Sunday, March 5, 2017 7:47 PM > > To: dev@dpdk.org > > Cc: Ananyev, Konstantin <konstantin.anan...@intel.com>; Richardson, > > Bruce <bruce.richard...@intel.com>; Ravi Kerur <rke...@gmail.com> > > 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 = 0; \ > > + val = strtoul((in), &end, (base)); \ > > + if (errno != 0 || end[0] != (dlm) || val > (lim)) \ > > + return -EINVAL; \ > > + (fd) = (typeof(fd))val; \ > > + (in) = end + 1; \ > > +} while (0) > > Hi, > > 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. >
Nevermind. I see that this macro was already there and you just moved it. So, it is not your problem. :-) John