[v2] cryptodev: speed up ops pool create

Message ID 20240216170334.55210-1-andrew.boyer@amd.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] cryptodev: speed up ops pool create |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Boyer, Andrew Feb. 16, 2024, 5:03 p.m. UTC
  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

Morten Brørup Feb. 16, 2024, 5:18 p.m. UTC | #1
> 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>
  
Akhil Goyal Feb. 22, 2024, 7:07 a.m. UTC | #2
> 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.
  

Patch

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;
 }