From: Stephen Hemminger <stephen@networkplumber.org>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Cc: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd: increase pktmbuf pool size
Date: Thu, 28 Dec 2017 12:36:42 -0800 [thread overview]
Message-ID: <20171228123642.39c7aca4@xeon-e3> (raw)
In-Reply-To: <20171228201906.22770-1-pbhagavatula@caviumnetworks.com>
On Fri, 29 Dec 2017 01:49:06 +0530
Pavan Nikhilesh <pbhagavatula@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.
You also don't need a cast of (unsigned int)8192, use 8192u instead
next prev parent reply other threads:[~2017-12-28 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-28 20:19 Pavan Nikhilesh
2017-12-28 20:36 ` Stephen Hemminger [this message]
2017-12-28 20:41 ` Pavan Nikhilesh
2018-01-02 9:53 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
2018-01-10 12:26 ` De Lara Guarch, Pablo
2018-01-15 11:18 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171228123642.39c7aca4@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
--cc=pbhagavatula@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).