[dpdk-dev] [PATCH] mempool: allow for user-owned mempool caches

Olivier Matz olivier.matz at 6wind.com
Fri Mar 25 11:55:46 CET 2016


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


More information about the dev mailing list