From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: Re: [PATCH] examples/l2fwd: increase pktmbuf pool size Date: Fri, 29 Dec 2017 02:11:14 +0530 Message-ID: <20171228204113.ljlkmeycmntjvbfg@Pavan-LT> References: <20171228201906.22770-1-pbhagavatula@caviumnetworks.com> <20171228123642.39c7aca4@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, dev@dpdk.org To: Stephen Hemminger Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0074.outbound.protection.outlook.com [104.47.40.74]) by dpdk.org (Postfix) with ESMTP id 0B0C523D for ; Thu, 28 Dec 2017 21:41:39 +0100 (CET) Content-Disposition: inline In-Reply-To: <20171228123642.39c7aca4@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Dec 28, 2017 at 12:36:42PM -0800, Stephen Hemminger wrote: > On Fri, 29 Dec 2017 01:49:06 +0530 > Pavan Nikhilesh 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.