From: Mattias Rönnblom Date: Mon, 9 Mar 2020 06:50:59 +0000 (+0100) Subject: event/dsw: reduce latency in low-load situations X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3db0a0984f42255a0c4c97b80c7ac1ded8f3dd86;p=dpdk.git event/dsw: reduce latency in low-load situations In DSW, in case a port can't produce any events for the application to consume, the port is considered idle. To slightly reduce wall-time latency, flush the port's output buffer in case of such an empty dequeue. Signed-off-by: Mattias Rönnblom --- diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c index d68b71b982..05abfb24c7 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -1242,11 +1242,11 @@ dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, * seem to improve performance. */ dsw_port_record_seen_events(port, events, dequeued); - } - /* XXX: Assuming the port can't produce any more work, - * consider flushing the output buffer, on dequeued == - * 0. - */ + } else /* Zero-size dequeue means a likely idle port, and thus + * we can afford trading some efficiency for a slightly + * reduced event wall-time latency. + */ + dsw_port_flush_out_buffers(dsw, port); #ifdef DSW_SORT_DEQUEUED dsw_stable_sort(events, dequeued, sizeof(events[0]), dsw_cmp_event);