[PATCH 4/4] eventdev: have timer adapter appropriately report idle
Mattias Rönnblom
mattias.ronnblom at ericsson.com
Mon Oct 10 16:54:06 CEST 2022
Update the Event Timer Adapter's service function to report as idle
(i.e., return -EAGAIN) in case no timer events were enqueued to the
event device.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>
---
lib/eventdev/rte_event_timer_adapter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index 1731770b5e..a0f14bf861 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -785,6 +785,7 @@ swtim_service_func(void *arg)
struct swtim *sw = swtim_pmd_priv(adapter);
uint16_t nb_evs_flushed = 0;
uint16_t nb_evs_invalid = 0;
+ const uint64_t prior_enq_count = sw->stats.ev_enq_count;
if (swtim_did_tick(sw)) {
rte_timer_alt_manage(sw->timer_data_id,
@@ -811,7 +812,7 @@ swtim_service_func(void *arg)
rte_event_maintain(adapter->data->event_dev_id,
adapter->data->event_port_id, 0);
- return 0;
+ return prior_enq_count == sw->stats.ev_enq_count ? -EAGAIN : 0;
}
/* The adapter initialization function rounds the mempool size up to the next
--
2.34.1
More information about the dev
mailing list