On Sat, Apr 3, 2021 at 7:49 PM Ashwin Sekhar T K <[email protected]> wrote:
>
> Marvell CN10k mempool supports batch enqueue/dequeue which can
> dequeue up to 512 pointers and enqueue up to 15 pointers using
> a single instruction.
>
> These batch operations require a DMA memory to enqueue/dequeue
> pointers. This patch adds the initialization of this DMA memory.
>
> Signed-off-by: Ashwin Sekhar T K <[email protected]>
> ---
> doc/guides/mempool/cnxk.rst | 5 +
> drivers/mempool/cnxk/cn10k_mempool_ops.c | 122 ++++++++++++++++++++++-
> drivers/mempool/cnxk/cnxk_mempool.h | 3 +
> drivers/mempool/cnxk/cnxk_mempool_ops.c | 13 ++-
> 4 files changed, 138 insertions(+), 5 deletions(-)
>
> +
> +static struct batch_op_data **batch_op_data;
Please remove the global variable as it will break the multi-process.
> +
> +#define BATCH_OP_DATA_GET(pool_id)
> \
> + batch_op_data[roc_npa_aura_handle_to_aura(pool_id)]
> +
> +#define BATCH_OP_DATA_SET(pool_id, op_data)
> \
> + do {
> \
> + uint64_t aura = roc_npa_aura_handle_to_aura(pool_id);
> \
> + batch_op_data[aura] = op_data;
> \
> + } while (0)
> +
Please check this can be made as static inline if there is NO performance cost.