Thread (238 messages) 238 messages, 10 authors, 2016-06-24

Re: [PATCH 1/5] mempool: add external mempool manager support

From: Olivier MATZ <hidden>
Date: 2016-02-05 09:26:52

Hi David,

On 02/04/2016 06:34 PM, Hunt, David wrote:
On 04/02/2016 14:52, Olivier MATZ wrote:
quoted
Hi David,
[snip]

Just a comment on one of your comments:
quoted
Why not using a similar mechanism than what we have for PMDs?

     void rte_eal_driver_register(struct rte_driver *driver)
     {
         TAILQ_INSERT_TAIL(&dev_driver_list, driver, next);
     }

To do that, you just need to add a TAILQ_ENTRY() in your
rte_mempool_handler structure. This would avoid to duplicate the
structure into a static array whose size is limited.

Accessing to the callbacks would be easier:

     return mp->mp_handler->put(mp->rt_pool, obj_table, n);
One of the iterations of the code did indeed use this mechanism, however
I ran into problems with multiple processes using the same mempool. In
that case, the 'mp_handler' element of the mempool in your return
statement  is only valid for one of the processes. Hence the need for
and index that's valid for all processes rather than a pointer that's
valid for only one. And it's not easy to quickly index into an element
in a queue, hence the array of 16 mempool_handler structs.
Oh you mean with a secondary processes, I got it now.

Are we sure we can expect that the registered handlers are the same
between multiple processes? For instance, if a handler is registered
with a plugin, the same plugins must be passed to all processes.

I don't see any better solution than yours (except removing secondary
processes of course ;) ).


Thanks for clarifying,
Olivier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help