eventdev/crypto: support appropriately report idle

Update the event crypto adapter's service function to report as idle
(i.e., return -EAGAIN) in case no crypto operations were performed.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
This commit is contained in:
Mattias Rönnblom 2022-10-10 16:54:03 +02:00 committed by Jerin Jacob
parent b828e0dade
commit 34d785571f

View File

@ -771,7 +771,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,
return nb_deq;
}
static void
static int
eca_crypto_adapter_run(struct event_crypto_adapter *adapter,
unsigned int max_ops)
{
@ -791,22 +791,26 @@ eca_crypto_adapter_run(struct event_crypto_adapter *adapter,
}
if (ops_left == max_ops)
if (ops_left == max_ops) {
rte_event_maintain(adapter->eventdev_id,
adapter->event_port_id, 0);
return -EAGAIN;
} else
return 0;
}
static int
eca_service_func(void *args)
{
struct event_crypto_adapter *adapter = args;
int ret;
if (rte_spinlock_trylock(&adapter->lock) == 0)
return 0;
eca_crypto_adapter_run(adapter, adapter->max_nb);
ret = eca_crypto_adapter_run(adapter, adapter->max_nb);
rte_spinlock_unlock(&adapter->lock);
return 0;
return ret;
}
static int