DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mauricio Vásquez" <mauricio.vasquezbernal@studenti.polito.it>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: "Venkatesan, Venky" <venky.venkatesan@intel.com>,
	Lazaros Koromilas <l@nofutznetworks.com>,
	 "Wiles, Keith" <keith.wiles@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mempool: allow for user-owned mempool caches
Date: Fri, 25 Mar 2016 21:42:45 +0100	[thread overview]
Message-ID: <CAPwdgqibGiEhtk36khS_VLO_C3050S7c0WMuZdO3fd693BctJg@mail.gmail.com> (raw)
In-Reply-To: <56F51932.3060500@6wind.com>

Hello to everybody,

I find this proposal very interesting as It could be used to solve an issue
that has not been mentioned yet: using memory pools shared with ivshmem.
Currently, due to the per lcore cache, it is not possible to allocate and
deallocate packets from the guest as it will cause cache corruption because
DPDK processes in the guest and in the host share some lcores_id.

If there is an API to register caches, the EAL could create and register
its own caches during the ivshmem initialization in the guest, avoiding
possible cache corruption problems.

I look forward to V2 in order to get a clear idea of how can it be used to
solve this issue.

Mauricio V,

On Fri, Mar 25, 2016 at 11:55 AM, Olivier Matz <olivier.matz@6wind.com>
wrote:

> Hi Venky,
>
> >> The main benefit of having an external cache is to allow mempool users
> >> (threads) to maintain a local cache even though they don't have a valid
> >> lcore_id (non-EAL threads). The fact that cache access is done by
> indexing
> >> with the lcore_id is what makes it difficult...
> >
> > Hi Lazaros,
> >
> > Alternative suggestion: This could actually be very simply done via
> creating an EAL API to register and return an lcore_id for a thread wanting
> to use DPDK services. That way, you could simply create your pthread, call
> the eal_register_thread() function that assigns an lcore_id to the caller
> (and internally sets up the per_lcore variable.
> >
> > The advantage of doing it this way is that you could extend it to other
> things other than the mempool that may need an lcore_id setup.
>
> From my opinion, externalize the cache structure as Lazaros suggests
> would make things simpler, especially in case of dynamic threads
> allocation/destruction.
>
> If a lcore_id regristration API is added in EAL, we still need a
> max lcore value when the mempool is created so the cache can be
> allocated. Moreover, the API would not be as simple, especially
> if it needs to support secondary processes.
>
>
> Regards,
> Olivier
>

  reply	other threads:[~2016-03-25 20:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 14:44 Lazaros Koromilas
2016-03-21 12:22 ` Olivier Matz
2016-03-21 13:15   ` Ananyev, Konstantin
2016-03-24 13:51     ` Lazaros Koromilas
2016-03-21 13:49   ` Wiles, Keith
2016-03-24 14:35     ` Lazaros Koromilas
2016-03-24 14:58       ` Venkatesan, Venky
2016-03-25 10:55         ` Olivier Matz
2016-03-25 20:42           ` Mauricio Vásquez [this message]
2016-03-25 20:46           ` Venkatesan, Venky
2016-03-24 15:03       ` Wiles, Keith

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=CAPwdgqibGiEhtk36khS_VLO_C3050S7c0WMuZdO3fd693BctJg@mail.gmail.com \
    --to=mauricio.vasquezbernal@studenti.polito.it \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=l@nofutznetworks.com \
    --cc=olivier.matz@6wind.com \
    --cc=venky.venkatesan@intel.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).