DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] mempool deleting and cache_size
@ 2015-04-15 19:15 Zoltan Kiss
  2015-04-15 19:24 ` Stephen Hemminger
  2015-04-17 10:28 ` Zoltan Kiss
  0 siblings, 2 replies; 9+ messages in thread
From: Zoltan Kiss @ 2015-04-15 19:15 UTC (permalink / raw)
  To: dev

Hi,

I have two questions regarding mempools:

- the first is trivial: how do you delete them? Can you? I can't see a 
function to do that, and none of the examples are doing such thing. When 
exactly it get deleted?
- during creation, cache_size have one requirement: it has to be smaller 
than RTE_MEMPOOL_CACHE_MAX_SIZE. And one recommendation: "n modulo 
cache_size == 0". Is there any more guideline to determine that number? 
E.g. now I'm using the biggest number which fits the above two conditions.

Regards,

Zoltan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-15 19:15 [dpdk-dev] mempool deleting and cache_size Zoltan Kiss
@ 2015-04-15 19:24 ` Stephen Hemminger
  2015-04-16  9:03   ` Gonzalez Monroy, Sergio
  2015-04-17 10:28 ` Zoltan Kiss
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2015-04-15 19:24 UTC (permalink / raw)
  To: Zoltan Kiss; +Cc: dev

On Wed, 15 Apr 2015 20:15:18 +0100
Zoltan Kiss <zoltan.kiss@linaro.org> wrote:

> Hi,
> 
> I have two questions regarding mempools:
> 
> - the first is trivial: how do you delete them? Can you? I can't see a 
> function to do that, and none of the examples are doing such thing. When 
> exactly it get deleted?

You can't delete them. They live in hugepage area and are persistent.
Correctly written code looks for them by name and reuses existing pool
if it is big enough.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-15 19:24 ` Stephen Hemminger
@ 2015-04-16  9:03   ` Gonzalez Monroy, Sergio
  2015-04-16  9:18     ` Gonzalez Monroy, Sergio
  2015-04-16  9:22     ` Marc Sune
  0 siblings, 2 replies; 9+ messages in thread
From: Gonzalez Monroy, Sergio @ 2015-04-16  9:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On 15/04/2015 20:24, Stephen Hemminger wrote:
> On Wed, 15 Apr 2015 20:15:18 +0100
> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>
>> Hi,
>>
>> I have two questions regarding mempools:
>>
>> - the first is trivial: how do you delete them? Can you? I can't see a
>> function to do that, and none of the examples are doing such thing. When
>> exactly it get deleted?
> You can't delete them. They live in hugepage area and are persistent.
> Correctly written code looks for them by name and reuses existing pool
> if it is big enough.
>
FYI, I'm looking into such functionality and also delete/destroy 
mempools (although still no plan on implementation).

Sergio

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-16  9:03   ` Gonzalez Monroy, Sergio
@ 2015-04-16  9:18     ` Gonzalez Monroy, Sergio
  2015-04-16  9:33       ` Olivier MATZ
  2015-04-16  9:22     ` Marc Sune
  1 sibling, 1 reply; 9+ messages in thread
From: Gonzalez Monroy, Sergio @ 2015-04-16  9:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On 16/04/2015 10:03, Gonzalez Monroy, Sergio wrote:
> On 15/04/2015 20:24, Stephen Hemminger wrote:
>> On Wed, 15 Apr 2015 20:15:18 +0100
>> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>>
>>> Hi,
>>>
>>> I have two questions regarding mempools:
>>>
>>> - the first is trivial: how do you delete them? Can you? I can't see a
>>> function to do that, and none of the examples are doing such thing. 
>>> When
>>> exactly it get deleted?
>> You can't delete them. They live in hugepage area and are persistent.
>> Correctly written code looks for them by name and reuses existing pool
>> if it is big enough.
>>
> FYI, I'm looking into such functionality and also delete/destroy 
> mempools (although still no plan on implementation).
>
> Sergio
Forgot to say, suggestions/ideas are more than welcome.

Sergio

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-16  9:03   ` Gonzalez Monroy, Sergio
  2015-04-16  9:18     ` Gonzalez Monroy, Sergio
@ 2015-04-16  9:22     ` Marc Sune
  2015-04-16  9:26       ` Gonzalez Monroy, Sergio
  1 sibling, 1 reply; 9+ messages in thread
From: Marc Sune @ 2015-04-16  9:22 UTC (permalink / raw)
  To: dev



On 16/04/15 11:03, Gonzalez Monroy, Sergio wrote:
> On 15/04/2015 20:24, Stephen Hemminger wrote:
>> On Wed, 15 Apr 2015 20:15:18 +0100
>> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>>
>>> Hi,
>>>
>>> I have two questions regarding mempools:
>>>
>>> - the first is trivial: how do you delete them? Can you? I can't see a
>>> function to do that, and none of the examples are doing such thing. 
>>> When
>>> exactly it get deleted?
>> You can't delete them. They live in hugepage area and are persistent.
>> Correctly written code looks for them by name and reuses existing pool
>> if it is big enough.
>>
> FYI, I'm looking into such functionality and also delete/destroy 
> mempools (although still no plan on implementation).
>

Also the memzones behind, or will be "lost/leaked" after a mempool 
destruction?

Marc

> Sergio

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-16  9:22     ` Marc Sune
@ 2015-04-16  9:26       ` Gonzalez Monroy, Sergio
  2015-04-17  8:32         ` Marc Sune
  0 siblings, 1 reply; 9+ messages in thread
From: Gonzalez Monroy, Sergio @ 2015-04-16  9:26 UTC (permalink / raw)
  To: Marc Sune; +Cc: dev

On 16/04/2015 10:22, Marc Sune wrote:
>
>
> On 16/04/15 11:03, Gonzalez Monroy, Sergio wrote:
>> On 15/04/2015 20:24, Stephen Hemminger wrote:
>>> On Wed, 15 Apr 2015 20:15:18 +0100
>>> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have two questions regarding mempools:
>>>>
>>>> - the first is trivial: how do you delete them? Can you? I can't see a
>>>> function to do that, and none of the examples are doing such thing. 
>>>> When
>>>> exactly it get deleted?
>>> You can't delete them. They live in hugepage area and are persistent.
>>> Correctly written code looks for them by name and reuses existing pool
>>> if it is big enough.
>>>
>> FYI, I'm looking into such functionality and also delete/destroy 
>> mempools (although still no plan on implementation).
>>
>
> Also the memzones behind, or will be "lost/leaked" after a mempool 
> destruction?
>
> Marc
>
>> Sergio
>
Sorry, my bad.
I did mean to say 'delete/destroy memzones' :)

Sergio

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-16  9:18     ` Gonzalez Monroy, Sergio
@ 2015-04-16  9:33       ` Olivier MATZ
  0 siblings, 0 replies; 9+ messages in thread
From: Olivier MATZ @ 2015-04-16  9:33 UTC (permalink / raw)
  To: Gonzalez Monroy, Sergio, Stephen Hemminger; +Cc: dev

Hi,

On 04/16/2015 11:18 AM, Gonzalez Monroy, Sergio wrote:
> On 16/04/2015 10:03, Gonzalez Monroy, Sergio wrote:
>> On 15/04/2015 20:24, Stephen Hemminger wrote:
>>> On Wed, 15 Apr 2015 20:15:18 +0100
>>> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have two questions regarding mempools:
>>>>
>>>> - the first is trivial: how do you delete them? Can you? I can't see a
>>>> function to do that, and none of the examples are doing such thing.
>>>> When
>>>> exactly it get deleted?
>>> You can't delete them. They live in hugepage area and are persistent.
>>> Correctly written code looks for them by name and reuses existing pool
>>> if it is big enough.
>>>
>> FYI, I'm looking into such functionality and also delete/destroy
>> mempools (although still no plan on implementation).
>>
>> Sergio
> Forgot to say, suggestions/ideas are more than welcome.


I think what is required is similar to what I did for the rte_rings
some time ago:

http://dpdk.org/browse/dpdk/commit/lib/librte_ring/rte_ring.c?id=a182620042aa297ba1dc88f3089537d94b51bcf9
http://dpdk.org/browse/dpdk/commit/lib/librte_ring/rte_ring.c?id=1d64e46eb8c4fb8085513e9be824f2377b9c70c7

The objective would be to allow to allocate a memory zone from
any mean (rte_malloc, malloc, ...), and have an API to initialize
a mempool inside of this zone.

Unfortunately it's probably not as trivial for mempool, as
the structure is more complex (it includes a ring, the
structure is followed by a variable-size table of physical
addresses), and there are some helpers to convert virtual
addresses to physical addresses, which is not easy to manage
if it's not memzones (especially with the xen part).

Regards,
Olivier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-16  9:26       ` Gonzalez Monroy, Sergio
@ 2015-04-17  8:32         ` Marc Sune
  0 siblings, 0 replies; 9+ messages in thread
From: Marc Sune @ 2015-04-17  8:32 UTC (permalink / raw)
  To: Gonzalez Monroy, Sergio; +Cc: dev



On 16/04/15 11:26, Gonzalez Monroy, Sergio wrote:
> On 16/04/2015 10:22, Marc Sune wrote:
>>
>>
>> On 16/04/15 11:03, Gonzalez Monroy, Sergio wrote:
>>> On 15/04/2015 20:24, Stephen Hemminger wrote:
>>>> On Wed, 15 Apr 2015 20:15:18 +0100
>>>> Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have two questions regarding mempools:
>>>>>
>>>>> - the first is trivial: how do you delete them? Can you? I can't 
>>>>> see a
>>>>> function to do that, and none of the examples are doing such 
>>>>> thing. When
>>>>> exactly it get deleted?
>>>> You can't delete them. They live in hugepage area and are persistent.
>>>> Correctly written code looks for them by name and reuses existing pool
>>>> if it is big enough.
>>>>
>>> FYI, I'm looking into such functionality and also delete/destroy 
>>> mempools (although still no plan on implementation).
>>>
>>
>> Also the memzones behind, or will be "lost/leaked" after a mempool 
>> destruction?
>>
>> Marc
>>
>>> Sergio
>>
> Sorry, my bad.
> I did mean to say 'delete/destroy memzones' :)

Good,

That would make the KNI memzone pool not necessary anymore:

http://article.gmane.org/gmane.comp.networking.dpdk.devel/6890/

If your patch gets accepted I will adapt that.

Marc

>
> Sergio

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] mempool deleting and cache_size
  2015-04-15 19:15 [dpdk-dev] mempool deleting and cache_size Zoltan Kiss
  2015-04-15 19:24 ` Stephen Hemminger
@ 2015-04-17 10:28 ` Zoltan Kiss
  1 sibling, 0 replies; 9+ messages in thread
From: Zoltan Kiss @ 2015-04-17 10:28 UTC (permalink / raw)
  To: dev

Hi,

On 15/04/15 20:15, Zoltan Kiss wrote:
> Hi,
>
> I have two questions regarding mempools:
>
> - the first is trivial: how do you delete them? Can you? I can't see a
> function to do that, and none of the examples are doing such thing. When
> exactly it get deleted?
> - during creation, cache_size have one requirement: it has to be smaller
> than RTE_MEMPOOL_CACHE_MAX_SIZE. And one recommendation: "n modulo
> cache_size == 0". Is there any more guideline to determine that number?
> E.g. now I'm using the biggest number which fits the above two conditions.
>
> Regards,
>
> Zoltan


Thanks for all the answers for the first one, but does anyone has an 
idea for the second one?

Zoli

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-17 10:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-15 19:15 [dpdk-dev] mempool deleting and cache_size Zoltan Kiss
2015-04-15 19:24 ` Stephen Hemminger
2015-04-16  9:03   ` Gonzalez Monroy, Sergio
2015-04-16  9:18     ` Gonzalez Monroy, Sergio
2015-04-16  9:33       ` Olivier MATZ
2015-04-16  9:22     ` Marc Sune
2015-04-16  9:26       ` Gonzalez Monroy, Sergio
2015-04-17  8:32         ` Marc Sune
2015-04-17 10:28 ` Zoltan Kiss

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).