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

Thomas Monjalon thomas.monjalon at 6wind.com
Tue May 17 07:31:12 CEST 2016


2016-04-14 11:42, Olivier Matz:
> From: Keith Wiles <keith.wiles at intel.com>
> 
> The rte_mempool structure is changed, which will cause an ABI change
> for this structure. Providing backward compat is not reasonable
> here as this structure is used in multiple defines/inlines.

The deprecation notice must be removed by this patch.

[...]
> +/**
>   * Calculate the size of the mempool header.
>   *
>   * @param mp
> @@ -254,9 +256,9 @@ struct rte_mempool {
>   * @param pgn
>   *   Number of pages used to store mempool objects.

A new parameter has been forgotten:
 * @param cs
 *   Size of the per-lcore cache.                                                                                

>   */
> -#define	MEMPOOL_HEADER_SIZE(mp, pgn)	(sizeof(*(mp)) + \
> -	RTE_ALIGN_CEIL(((pgn) - RTE_DIM((mp)->elt_pa)) * \
> -	sizeof ((mp)->elt_pa[0]), RTE_CACHE_LINE_SIZE))
> +#define MEMPOOL_HEADER_SIZE(mp, pgn, cs) \
> +	(sizeof(*(mp)) + __PA_SIZE(mp, pgn) + (((cs) == 0) ? 0 : \
> +	(sizeof(struct rte_mempool_cache) * RTE_MAX_LCORE)))

Applied with above changes


More information about the dev mailing list