Skip to content

Commit

Permalink
eventdev/timer: fix buffer flush
Browse files Browse the repository at this point in the history
[ upstream commit 53b97347cc84e8df53426c7917a4b65296264c02 ]

The SW event timer adapter attempts to flush its event buffer on every
adapter tick. If events remain in the buffer after the attempt, another
attempt to flush won't occur until the next adapter tick, which delays
the enqueue of those events to the event device unnecessarily.

Move the buffer flush call so that it happens with every invocation of
the service function, rather than on every adapter tick, to avoid the
delay.

Fixes: cc7b73e ("eventdev: add new software timer adapter")

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
  • Loading branch information
egcarril authored and kevintraynor committed Jul 11, 2023
1 parent 63daa71 commit 44a0ae7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/eventdev/rte_event_timer_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,17 +797,18 @@ swtim_service_func(void *arg)
sw->n_expired_timers);
sw->n_expired_timers = 0;

event_buffer_flush(&sw->buffer,
adapter->data->event_dev_id,
adapter->data->event_port_id,
&nb_evs_flushed,
&nb_evs_invalid);

sw->stats.ev_enq_count += nb_evs_flushed;
sw->stats.ev_inv_count += nb_evs_invalid;
sw->stats.adapter_tick_count++;
}

event_buffer_flush(&sw->buffer,
adapter->data->event_dev_id,
adapter->data->event_port_id,
&nb_evs_flushed,
&nb_evs_invalid);

sw->stats.ev_enq_count += nb_evs_flushed;
sw->stats.ev_inv_count += nb_evs_invalid;

rte_event_maintain(adapter->data->event_dev_id,
adapter->data->event_port_id, 0);

Expand Down

0 comments on commit 44a0ae7

Please sign in to comment.