[dpdk-dev] [PATCH] examples/l2fwd: increase pktmbuf pool size

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Thu Dec 28 21:41:14 CET 2017


On Thu, Dec 28, 2017 at 12:36:42PM -0800, Stephen Hemminger wrote:
> On Fri, 29 Dec 2017 01:49:06 +0530
> Pavan Nikhilesh <pbhagavatula at caviumnetworks.com> wrote:
>
> > +/*
> > + * This expression is used to calculate the number of mbufs needed
> > + * depending on user input, taking  into account memory for rx and
> > + * tx hardware rings, cache per lcore and mbuf pkt burst per port
> > + * per lcore. RTE_MAX is used to ensure that NB_MBUF never goes below
> > + * a minimum value of 8192
> > + */
> > +#define NB_MBUF RTE_MAX(\
> > +		nb_ports * (nb_rxd + nb_txd + MAX_PKT_BURST +\
> > +		nb_lcores * MEMPOOL_CACHE_SIZE), (unsigned int)8192)
>
> Why not put this inplace where it is used, rather than keeping
> the define? Also good practice with macros is to not have the
> macro depend on variables that are in context at that point.

Currently, l3fwd is doing the same thing with macros but I do agree it
would be clean using it inplace will modify in next version.

>
> You also don't need a cast of (unsigned int)8192, use 8192u instead

Thanks for the heads up will remove the cast in next version.

Pavan.


More information about the dev mailing list