From 34d785571fb1083e2fc6ca00fc32bae7dd76425e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Mon, 10 Oct 2022 16:54:03 +0200 Subject: [PATCH] eventdev/crypto: support appropriately report idle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Abhinandan Gujjar --- lib/eventdev/rte_event_crypto_adapter.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index a11cbcf4f3..59777726f6 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -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