eventdev/timer: support appropriately report idle

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@ericsson.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
This commit is contained in:
Mattias Rönnblom 2022-10-10 16:54:06 +02:00 committed by Jerin Jacob
parent 35d052356b
commit ed88c5a5e4

View File

@ -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