From 61cdc0981084f049067626b0123db700035120df Mon Sep 17 00:00:00 2001 From: Alexander Skorichenko Date: Mon, 24 Apr 2023 09:34:23 +0200 Subject: crypto-sw-scheduler: fix interrupt mode Type: fix Currently sw_scheduler runs interchangeably over queues of one selected type either ENCRYPT or DECRYPT. Then switches the type for the next run. This works fine in polling mode as missed frames get processed on the next run. In interrupt mode if all of the workers miss a frame on the first run the interrupt flag is lowered so the frame remains pending in queues waiting for another crypto event to raise the interrupt. With this fix force sw_scheduler in interrupt mode check the second half of the queues if the first pass returned no results. This guarantees a pending frame gets into processing before interrupt is reset. Change-Id: I7e91d125702336eba72c6a3abaeabcae010d396a Signed-off-by: Alexander Skorichenko --- src/plugins/crypto_sw_scheduler/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/crypto_sw_scheduler/main.c b/src/plugins/crypto_sw_scheduler/main.c index 563e3591191..abdffab2b9c 100644 --- a/src/plugins/crypto_sw_scheduler/main.c +++ b/src/plugins/crypto_sw_scheduler/main.c @@ -458,6 +458,11 @@ 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) { @@ -568,6 +573,11 @@ crypto_sw_scheduler_process_aead (vlib_main_t *vm, return f; } + if (!found && recheck_queues) + { + recheck_queues = 0; + goto run_half_queues; + } return 0; } -- cgit 1.2.3-korg