From: Olivier MATZ <olivier.matz@6wind.com>
To: "Sanford, Robert" <rsanford@akamai.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "declan.doherty@intel.com" <declan.doherty@intel.com>,
"pablo.de.lara.guarch@intel.com" <pablo.de.lara.guarch@intel.com>
Subject: Re: [dpdk-dev] [PATCH 2/4] mempool: make cache flush threshold macro public
Date: Wed, 24 Aug 2016 18:15:25 +0200 [thread overview]
Message-ID: <57BDC81D.2000902@6wind.com> (raw)
In-Reply-To: <D6827E65-62EF-494B-83B6-BBCF9649D9F3@akamai.com>
Hi Robert,
On 08/23/2016 06:07 PM, Sanford, Robert wrote:
> Hi Olivier,
>
> On 8/23/16, 11:09 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote:
>
> Hi Robert,
>
> On 08/01/2016 10:42 PM, Robert Sanford wrote:
> > Rename macros that calculate a mempool cache flush threshold, and
> > move them from rte_mempool.c to rte_mempool.h, so that the bonding
> > driver can accurately calculate its mbuf requirements.
> >
> > Signed-off-by: Robert Sanford <rsanford@akamai.com>
> > ---
> > lib/librte_mempool/rte_mempool.c | 8 ++------
> > lib/librte_mempool/rte_mempool.h | 7 +++++++
> > 2 files changed, 9 insertions(+), 6 deletions(-)
> >
> > [...]
> >
> > --- a/lib/librte_mempool/rte_mempool.h
> > +++ b/lib/librte_mempool/rte_mempool.h
> > @@ -263,6 +263,13 @@ struct rte_mempool {
> > #define MEMPOOL_F_NO_PHYS_CONTIG 0x0020 /**< Don't need physically contiguous objs. */
> >
> > /**
> > + * Calculate the threshold before we flush excess elements.
> > + */
> > +#define RTE_MEMPOOL_CACHE_FLUSHTHRESH_MULTIPLIER 1.5
> > +#define RTE_MEMPOOL_CALC_CACHE_FLUSHTHRESH(c) \
> > + ((typeof(c))((c) * RTE_MEMPOOL_CACHE_FLUSHTHRESH_MULTIPLIER))
> > +
> > +/**
> > * @internal When debug is enabled, store some statistics.
> > *
> > * @param mp
> >
>
> What do you think of using a static inline function instead of a macro ?
>
>
> Regards,
> Olivier
> --
>
> Yes, an inline function is better than a macro. We still need to move the #define MULTIPLIER from rte_mempool.c to rte_mempool.h.
>
> How is this for the prototype?
> static inline unsigned rte_mempool_calc_cache_flushthresh(unsigned cache_size)
>
> Where in the .h should we place the function, right below the MULTIPLIER definition?
Yep, looks good, thanks.
Maybe "unsigned" -> "unsigned int", because checkpatch may complain...
Regards,
Olivier
next prev parent reply other threads:[~2016-08-24 16:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-01 20:42 [dpdk-dev] [PATCH 0/4] net/bonding: bonding and LACP fixes Robert Sanford
2016-08-01 20:42 ` [dpdk-dev] [PATCH 1/4] testpmd: fix LACP ports to work with idle links Robert Sanford
2017-06-22 1:25 ` Wu, Jingjing
2017-10-31 1:07 ` Ferruh Yigit
2017-11-01 20:06 ` Ferruh Yigit
2016-08-01 20:42 ` [dpdk-dev] [PATCH 2/4] mempool: make cache flush threshold macro public Robert Sanford
2016-08-23 15:09 ` Olivier MATZ
2016-08-23 16:07 ` Sanford, Robert
2016-08-24 16:15 ` Olivier MATZ [this message]
2016-08-01 20:42 ` [dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool size Robert Sanford
2016-08-23 15:09 ` Olivier MATZ
2016-08-23 20:01 ` Sanford, Robert
2016-08-24 16:14 ` Olivier MATZ
2016-11-07 16:02 ` Kulasek, TomaszX
2016-08-01 20:42 ` [dpdk-dev] [PATCH 4/4] net/bonding: fix configuration of LACP slaves Robert Sanford
2016-11-07 16:03 ` Kulasek, TomaszX
2017-02-08 17:14 ` [dpdk-dev] [PATCH 0/4] net/bonding: bonding and LACP fixes Thomas Monjalon
2017-03-09 13:19 ` Thomas Monjalon
2017-03-09 16:57 ` Declan Doherty
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=57BDC81D.2000902@6wind.com \
--to=olivier.matz@6wind.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
--cc=rsanford@akamai.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).