[dpdk-dev] [PATCH v5] mempool: reduce rte_mempool structure size

Olivier MATZ olivier.matz at 6wind.com
Thu Apr 14 15:43:41 CEST 2016


Hi,

On 04/14/2016 03:28 PM, Wiles, Keith wrote:
>> From: Keith Wiles <keith.wiles at intel.com>
>> --- a/app/test/test_mempool.c
>> +++ b/app/test/test_mempool.c
>> @@ -122,8 +122,8 @@ test_mempool_basic(void)
>> 		return -1;
>>
>> 	printf("get private data\n");
>> -	if (rte_mempool_get_priv(mp) !=
>> -			(char*) mp + MEMPOOL_HEADER_SIZE(mp, mp->pg_num))
>> +	if (rte_mempool_get_priv(mp) != (char *)mp +
>> +			MEMPOOL_HEADER_SIZE(mp, mp->pg_num, mp->cache_size))
>
> Should we not add the RTE_PTR_ADD() here as well?

The displayed error message was "cast increases required alignment
of target type", and in this case the alignment constraint of mp
is higher than the constraint for char * (1). So I think there is
no issue here... at least I can say it compiles without error.

Regards,
Olivier


More information about the dev mailing list