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 <askorichenko@netgate.com>
This commit is contained in:

committed by
Matthew Smith

parent
980f3fb2d3
commit
61cdc09810
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user