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:
parent
b828e0dade
commit
34d785571f
@ -771,7 +771,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,
|
|||||||
return nb_deq;
|
return nb_deq;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
eca_crypto_adapter_run(struct event_crypto_adapter *adapter,
|
eca_crypto_adapter_run(struct event_crypto_adapter *adapter,
|
||||||
unsigned int max_ops)
|
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,
|
rte_event_maintain(adapter->eventdev_id,
|
||||||
adapter->event_port_id, 0);
|
adapter->event_port_id, 0);
|
||||||
|
return -EAGAIN;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
eca_service_func(void *args)
|
eca_service_func(void *args)
|
||||||
{
|
{
|
||||||
struct event_crypto_adapter *adapter = args;
|
struct event_crypto_adapter *adapter = args;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (rte_spinlock_trylock(&adapter->lock) == 0)
|
if (rte_spinlock_trylock(&adapter->lock) == 0)
|
||||||
return 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);
|
rte_spinlock_unlock(&adapter->lock);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user