summaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_sw_scheduler
diff options
context:
space:
mode:
authorNiyaz Murshed <niyaz.murshed@arm.com>2024-02-21 19:52:31 +0000
committerFan Zhang <fanzhang.oss@gmail.com>2024-04-15 23:30:55 +0000
commitdd5f75c6fd729985b988a69652d99ad11ba7efe7 (patch)
treeac7d8861a3286b45467f85d234e1592ee8ae75c9 /src/plugins/crypto_sw_scheduler
parent4ebe5eef8a696a349105d6bdf21c8c11db938a1d (diff)
crypto-sw-scheduler: crypto-dispatch improvement
Currently sw_scheduler runs interchangeably over queues of one selected type either ENCRYPT or DECRYPT, then switches the type for the next run. This runs perfectly when we have elements in both ENCRYPT and DECRYPT queues, however, this leads to performance degradation when only one of the queues have elements i.e either all traffic is to be encrypted or decrypted. If all operations are encryption, then 50% of the time, the loop exits without dequeueing.With this change, that dequeueing happens on every loop. This increases the performance of single mode operation (ecryption or decryption) by over 15%. This change was also added in commit https://github.com/FDio/vpp/commit/61cdc0981084f049067626b0123db700035120df to fix similar performance issue when the crypto-dispatch node is in interrupt node, however was removed by https://github.com/FDio/vpp/commit/9a9604b09f15691d7c4ddf29afd99a31e7e31eed which has its own limitations. Type: improvement Change-Id: I15c1375427e06187e9c4faf2461ab79935830802 Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
Diffstat (limited to 'src/plugins/crypto_sw_scheduler')
-rw-r--r--src/plugins/crypto_sw_scheduler/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/crypto_sw_scheduler/main.c b/src/plugins/crypto_sw_scheduler/main.c
index b32c8ae0594..73a158e86b2 100644
--- a/src/plugins/crypto_sw_scheduler/main.c
+++ b/src/plugins/crypto_sw_scheduler/main.c
@@ -455,7 +455,9 @@ crypto_sw_scheduler_dequeue (vlib_main_t *vm, u32 *nb_elts_processed,
crypto_sw_scheduler_queue_t *current_queue = 0;
u32 tail, head;
u8 found = 0;
+ u8 recheck_queues = 1;
+run_next_queues:
/* get a pending frame to process */
if (ptd->self_crypto_enabled)
{
@@ -565,6 +567,11 @@ crypto_sw_scheduler_dequeue (vlib_main_t *vm, u32 *nb_elts_processed,
return f;
}
+ if (!found && recheck_queues)
+ {
+ recheck_queues = 0;
+ goto run_next_queues;
+ }
return 0;
}