summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorXiaoming Jiang <jiangxiaoming@outlook.com>2023-03-09 02:03:50 +0000
committerFan Zhang <fanzhang.oss@gmail.com>2023-06-01 10:17:50 +0000
commit9a9604b09f15691d7c4ddf29afd99a31e7e31eed (patch)
tree59c664f02a4cb80254b8e9521e7f0e8e9347651a /src/plugins
parent8340b249974f1787f5930b8a50da5c32ec7a3fc2 (diff)
crypto: make crypto-dispatch node working in adaptive mode
This patch can make crypto dispatch node adaptively switching between pooling and interrupt mode, and improve vpp overall performance. Type: improvement Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: I845ed1d29ba9f3c507ea95a337f6dca7f8d6e24e
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/crypto_sw_scheduler/main.c14
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c3
-rw-r--r--src/plugins/wireguard/wireguard.c2
3 files changed, 3 insertions, 16 deletions
diff --git a/src/plugins/crypto_sw_scheduler/main.c b/src/plugins/crypto_sw_scheduler/main.c
index abdffab2b9c..1cc7a08ca11 100644
--- a/src/plugins/crypto_sw_scheduler/main.c
+++ b/src/plugins/crypto_sw_scheduler/main.c
@@ -25,14 +25,14 @@ crypto_sw_scheduler_set_worker_crypto (u32 worker_idx, u8 enabled)
crypto_sw_scheduler_main_t *cm = &crypto_sw_scheduler_main;
vlib_thread_main_t *tm = vlib_get_thread_main ();
crypto_sw_scheduler_per_thread_data_t *ptd = 0;
- u32 count = 0, i = vlib_num_workers () > 0;
+ u32 count = 0, i;
if (worker_idx >= vlib_num_workers ())
{
return VNET_API_ERROR_INVALID_VALUE;
}
- for (; i < tm->n_vlib_mains; i++)
+ for (i = 0; i < tm->n_vlib_mains; i++)
{
ptd = cm->per_thread_data + i;
count += ptd->self_crypto_enabled;
@@ -458,11 +458,6 @@ crypto_sw_scheduler_process_aead (vlib_main_t *vm,
u32 tail, head;
u8 found = 0;
- u8 recheck_queues =
- crypto_main.dispatch_mode == VNET_CRYPTO_ASYNC_DISPATCH_INTERRUPT;
-
- run_half_queues:
-
/* get a pending frame to process */
if (ptd->self_crypto_enabled)
{
@@ -573,11 +568,6 @@ crypto_sw_scheduler_process_aead (vlib_main_t *vm,
return f;
}
- if (!found && recheck_queues)
- {
- recheck_queues = 0;
- goto run_half_queues;
- }
return 0;
}
diff --git a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
index a8265b82c82..3a2f46e6739 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
@@ -516,8 +516,7 @@ cryptodev_raw_dequeue (vlib_main_t *vm, u32 *nb_elts_processed,
}
}
- if (cm->dispatch_mode == VNET_CRYPTO_ASYNC_DISPATCH_INTERRUPT &&
- inflight > 0)
+ if (inflight > 0)
vlib_node_set_interrupt_pending (vlib_get_main_by_index (vm->thread_index),
cm->crypto_node_index);
diff --git a/src/plugins/wireguard/wireguard.c b/src/plugins/wireguard/wireguard.c
index 5d73638f8f9..a87f73dc6f2 100644
--- a/src/plugins/wireguard/wireguard.c
+++ b/src/plugins/wireguard/wireguard.c
@@ -30,8 +30,6 @@ wg_async_post_next_t wg_decrypt_async_next;
void
wg_set_async_mode (u32 is_enabled)
{
- vnet_crypto_request_async_mode (is_enabled);
-
if (is_enabled)
wg_op_mode_set_ASYNC ();
else