From e4db945e1cd960f94f3e3f3d1049fd98cfadbeb1 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Tue, 30 Mar 2021 17:31:38 +0100 Subject: dpdk: selection of cryptodev engine data-path Type: improvement This patch combined cryptodev op and cryptodev raw API data paths into one and makes the engine run-timely select which data path is used: if all cryptodev devices support RTE_CRYPTODEV_FF_SYM_RAW_DP feature flag, the raw data path API is used, otherwise the traditional data path is used. Signed-off-by: Fan Zhang Change-Id: Ibbd7c4405288bd9a48a34878954fd3040df7b4ad --- src/vnet/crypto/crypto.c | 5 +++-- src/vnet/crypto/crypto.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vnet/crypto') diff --git a/src/vnet/crypto/crypto.c b/src/vnet/crypto/crypto.c index 2ce1b895eb2..b98d219d385 100644 --- a/src/vnet/crypto/crypto.c +++ b/src/vnet/crypto/crypto.c @@ -302,7 +302,7 @@ vnet_crypto_register_async_handler (vlib_main_t * vm, u32 engine_index, } ae = vec_elt_at_index (cm->engines, otd->active_engine_index_async); - if (ae->priority < e->priority) + if (ae->priority <= e->priority) { otd->active_engine_index_async = engine_index; cm->enqueue_handlers[opt] = enqueue_hdl; @@ -717,7 +717,8 @@ vnet_crypto_init (vlib_main_t * vm) cm->async_alg_index_by_name = hash_create_string (0, sizeof (uword)); vec_validate_aligned (cm->threads, tm->n_vlib_mains, CLIB_CACHE_LINE_BYTES); vec_foreach (ct, cm->threads) - pool_alloc_aligned (ct->frame_pool, 1024, CLIB_CACHE_LINE_BYTES); + pool_alloc_aligned (ct->frame_pool, VNET_CRYPTO_FRAME_POOL_SIZE, + CLIB_CACHE_LINE_BYTES); vec_validate (cm->algs, VNET_CRYPTO_N_ALGS); vec_validate (cm->async_algs, VNET_CRYPTO_N_ASYNC_ALGS); clib_bitmap_validate (cm->async_active_ids, VNET_CRYPTO_ASYNC_OP_N_IDS - 1); diff --git a/src/vnet/crypto/crypto.h b/src/vnet/crypto/crypto.h index 670be69fd4f..7db591fcf86 100644 --- a/src/vnet/crypto/crypto.h +++ b/src/vnet/crypto/crypto.h @@ -19,6 +19,7 @@ #include #define VNET_CRYPTO_FRAME_SIZE 64 +#define VNET_CRYPTO_FRAME_POOL_SIZE 1024 /* CRYPTO_ID, PRETTY_NAME, KEY_LENGTH_IN_BYTES */ #define foreach_crypto_cipher_alg \ -- cgit 1.2.3-korg