[1/8] event/dsw: reduce latency in low-load situations

Message ID 20200309065106.23800-2-mattias.ronnblom@ericsson.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series DSW performance and statistics improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Mattias Rönnblom March 9, 2020, 6:50 a.m. UTC
  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 <mattias.ronnblom@ericsson.com>
---
 drivers/event/dsw/dsw_event.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
index 296adea18..7f1f29218 100644
--- a/drivers/event/dsw/dsw_event.c
+++ b/drivers/event/dsw/dsw_event.c
@@ -1245,11 +1245,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);