From: Olivier Matz <olivier.matz@6wind.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] mempool: indicate the usages of multi memzones
Date: Tue, 16 Jan 2018 14:51:55 +0100 [thread overview]
Message-ID: <20180116135155.x5g576ax5gsy2ezv@platinum> (raw)
In-Reply-To: <cb5b8b31-67ec-3258-c554-085f69f21059@nxp.com>
On Fri, Dec 22, 2017 at 09:48:01PM +0530, Hemant Agrawal wrote:
> On 12/22/2017 7:29 PM, Olivier MATZ wrote:
> > On Wed, Dec 20, 2017 at 05:29:59PM +0530, Hemant Agrawal wrote:
> > > On 12/19/2017 6:38 PM, Hemant Agrawal wrote:
> > > >
> > > > > That's true, I commented too fast :)
> > > > > And what about using mp->nb_mem_chunks instead? Would it do the job
> > > > > in your use-case?
> > > >
> > > > It should work. Let me check it out.
> > >
> > > There is a slight problem with nb_mem_chunks.
> > >
> > > It is getting incremented in the end of "rte_mempool_populate_phys",
> > > while the elements are getting populated before it in the call of
> > > mempool_add_elem.
> > >
> > > I can use nb_mem_chunks are '0' check. However it can break in future if
> > > mempool_populate_phys changes.
> >
> > Sorry, I'm not sure I'm getting what you say.
> >
> > My question was about using mp->nb_mem_chunks instead of a new flag in the
> > dppa driver. Am I missing something?
> >
>
> mp->nb_mem_chunks gets finalized when the mempool is fully created. It's
> value is transient before that i.e. it will keep on changing on the every
> call to rte_mempool_populate_phys.
>
> However, we need this information on the very first element allocation. So,
> nb_mem_chunks will not work.
I see 2 other alternatives:
1/ in your driver, register a callback rte_mempool_ops_register_memory_area()
that sets a private flag if (len < total_elt_sz * mp->size).
2/ Move
STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next);
mp->nb_mem_chunks++;
before the calls to mempool_add_elem(), and in your driver check if
SLIST_FIRST(&mp->mem_list)->len < total_elt_sz * mp->size
If we can avoid to again create another flag, it is better.
next prev parent reply other threads:[~2018-01-16 13:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 12:31 Hemant Agrawal
2017-12-06 12:31 ` [dpdk-dev] [PATCH 2/2] mempool/dpaa: optimize phy to virt conversion Hemant Agrawal
2017-12-19 10:24 ` [dpdk-dev] [PATCH 1/2] mempool: indicate the usages of multi memzones Olivier MATZ
2017-12-19 10:46 ` Hemant Agrawal
2017-12-19 11:02 ` Olivier MATZ
2017-12-19 13:08 ` Hemant Agrawal
2017-12-20 11:59 ` Hemant Agrawal
2017-12-22 13:59 ` Olivier MATZ
2017-12-22 16:18 ` Hemant Agrawal
2018-01-16 13:51 ` Olivier Matz [this message]
2018-01-17 7:49 ` Hemant Agrawal
2018-01-05 10:52 ` santosh
2018-01-17 8:51 ` [dpdk-dev] [PATCH v2] mempool/dpaa: optimize phy to virt conversion Hemant Agrawal
2018-01-18 23:28 ` 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=20180116135155.x5g576ax5gsy2ezv@platinum \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.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).