[dpdk-dev] [PATCH v2 4/4] autotest: fix func reentrancy

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Tue Apr 5 13:00:02 CEST 2016



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Olivier Matz
> Sent: Tuesday, April 05, 2016 8:36 AM
> To: dev at dpdk.org
> Cc: Richardson, Bruce
> Subject: [dpdk-dev] [PATCH v2 4/4] autotest: fix func reentrancy
> 
> The previous code in func_reentrancy autotest was doing in parallel
> something close to:
> 
>   name = "common_name";
>   do several times {
>       obj = allocate_an_object(name)   // obj = ring, mempool, hash, lpm, ...
>       if (obj == NULL && lookup(name) == NULL)
>           return TEST_FAIL;
>   }
> 
> This code is not safe. For instance:
> 
>    mempool_create() is called on core 0, it creates a ring. At the same
>    time on core 1, mempool_create() is called too and the creation of the
>    ring fails (EEXIST). But the mempool lookup can fail on core 1 if
>    the mempool is not added in the list by core 0.
> 
> This commit fixes the func_reentrancy autotest that now works with all
> tested class of objects.
> 
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>

Hi Olivier,

Could you include a "Fixes" line here?

Thanks,
Pablo


More information about the dev mailing list