[dpdk-dev] [PATCH v8 1/1] fbarray: fix duplicated fbarray file in secondary

Yasufumi Ogawa yasufum.o at gmail.com
Fri Dec 6 14:18:23 CET 2019


On 2019/12/06 19:44, Burakov, Anatoly wrote:
> On 27-Nov-19 8:48 AM, Yasufumi Ogawa wrote:
>> From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
>>
>> In secondary_msl_create_walk(), it creates a file for fbarrays with its
>> PID for reserving unique name among secondary processes. However, it
>> does not work if several secondaries run as app containers because each
>> of containerized secondary has PID 1, and failed to reserve unique name
>> other than first one. To reserve unique name in each of containers, use
>> hostname in addition to PID.
>>
>> Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
>> ---
>>   lib/librte_eal/common/include/rte_fbarray.h |  7 ++++++-
>>   lib/librte_eal/linux/eal/eal_memalloc.c     | 11 ++++++++---
>>   2 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/librte_eal/common/include/rte_fbarray.h 
>> b/lib/librte_eal/common/include/rte_fbarray.h
>> index 6dccdbec9..df003b8dc 100644
>> --- a/lib/librte_eal/common/include/rte_fbarray.h
>> +++ b/lib/librte_eal/common/include/rte_fbarray.h
>> @@ -39,7 +39,12 @@ extern "C" {
>>   #include <rte_compat.h>
>>   #include <rte_rwlock.h>
>> -#define RTE_FBARRAY_NAME_LEN 64
>> +/* Filename of fbarray is defined as a combination of several params
>> + * such as "fbarray_memseg-1048576k-0-0_PID_HOSTNAME".
>> + * The length of string before PID can be 32bytes, and the length of
>> + * PID can be 7bytes maximamly. Final 1 byte is for null terminator.
>> + */
>> +#define RTE_FBARRAY_NAME_LEN (32 + 7 + 1 + HOST_NAME_MAX + 1)
> 
> This breaks ABI, but i believe this doesn't break *stable* ABI, so it is 
> OK.
Thank you so much!

Yasufumi
> 
> Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 


More information about the dev mailing list