[dpdk-dev] [PATCH v3 4/5] compress/zlib: support burst enqueue/dequeue

Stephen Hemminger stephen at networkplumber.org
Mon Jul 23 19:35:57 CEST 2018


On Mon, 23 Jul 2018 17:14:26 +0000
"Verma, Shally" <Shally.Verma at cavium.com> wrote:

> >-----Original Message-----
> >From: Stephen Hemminger <stephen at networkplumber.org>
> >Sent: 23 July 2018 22:24
> >To: Verma, Shally <Shally.Verma at cavium.com>
> >Cc: pablo.de.lara.guarch at intel.com; dev at dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya at cavium.com>; Challa,
> >Mahipal <Mahipal.Challa at cavium.com>; Gupta, Ashish <Ashish.Gupta at cavium.com>; Sahu, Sunila <Sunila.Sahu at cavium.com>;
> >Sahu, Sunila <Sunila.Sahu at cavium.com>
> >Subject: Re: [dpdk-dev] [PATCH v3 4/5] compress/zlib: support burst enqueue/dequeue
> >
> >External Email
> >
> >On Sat, 21 Jul 2018 23:47:48 +0530
> >Shally Verma <shally.verma at caviumnetworks.com> wrote:
> >  
> >> -/** Parse comp xform and set private xform/stream parameters */
> >> +/** Compute next mbuf in the list, assign data buffer and length,
> >> + *  returns 0 if mbuf is NULL
> >> + */
> >> +#define COMPUTE_BUF(mbuf, data, len)         \
> >> +             ((mbuf = mbuf->next) ?          \
> >> +             (data = rte_pktmbuf_mtod(mbuf, uint8_t *)),     \
> >> +             (len = rte_pktmbuf_data_len(mbuf)) : 0)
> >> +  
> >
> >Could this be an inline not a macro?  
> [Shally] Again what goes in favour of inline here? Just curious to know if DPDK has any preferred guidelines regarding this?
> 
> Thanks
> Shally 


Macros have no type checking and are harder to debug.
They should only be used when doing generic code (ie template like).


More information about the dev mailing list