[v2] cryptodev: speed up ops pool create
Checks
Commit Message
Use rte_mempool_virt2iova(), which uses arithmetic based on the mempool
state, rather than rte_mem_virt2iova(), which uses syscalls to look at
the proc filesystem. This speeds up pool create by more than 90%.
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
lib/cryptodev/rte_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> From: Andrew Boyer [mailto:andrew.boyer@amd.com]
> Sent: Friday, 16 February 2024 18.04
>
> Use rte_mempool_virt2iova(), which uses arithmetic based on the mempool
> state, rather than rte_mem_virt2iova(), which uses syscalls to look at
> the proc filesystem. This speeds up pool create by more than 90%.
>
> Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
> ---
> lib/cryptodev/rte_cryptodev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/cryptodev/rte_cryptodev.c
> b/lib/cryptodev/rte_cryptodev.c
> index b233c0ecd7..886eb7adc4 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -2573,7 +2573,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
>
> __rte_crypto_op_reset(op, type);
>
> - op->phys_addr = rte_mem_virt2iova(_op_data);
> + op->phys_addr = rte_mempool_virt2iova(_op_data);
> op->mempool = mempool;
> }
>
> --
> 2.17.1
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Use rte_mempool_virt2iova(), which uses arithmetic based on the mempool
> state, rather than rte_mem_virt2iova(), which uses syscalls to look at
> the proc filesystem. This speeds up pool create by more than 90%.
>
> Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
@@ -2573,7 +2573,7 @@ rte_crypto_op_init(struct rte_mempool *mempool,
__rte_crypto_op_reset(op, type);
- op->phys_addr = rte_mem_virt2iova(_op_data);
+ op->phys_addr = rte_mempool_virt2iova(_op_data);
op->mempool = mempool;
}