event/dsw: avoid credit leak on oversized enqueue bursts
authorMattias Rönnblom <mattias.ronnblom@ericsson.com>
Tue, 14 Jan 2020 18:03:38 +0000 (19:03 +0100)
committerJerin Jacob <jerinj@marvell.com>
Tue, 14 Jan 2020 19:41:09 +0000 (20:41 +0100)
commit0c4155c7b5b51a60f676c1d7279bfcd1b14acd38
treefd116c0d40a00ca267a406c6221e97b0931c0975
parent345a22d5ec1ab70e9d965ae50558049e6c0f2f8d
event/dsw: avoid credit leak on oversized enqueue bursts

If an application issues rte_event_enqueue_new_burst() or
rte_event_enqueue_forward_burst() call with a burst of events longer
than the configured max enqueue burst size, DSW allocates credits not
only for events actually enqueued, but for the complete burst. If this
process is repeated, enough credits will have leaked to cause the
event device to backpressure (i.e. disallow) any new enqueue
operations.

In addition, the port-level enqueue xstats will log the wrong number
of events enqueued for oversized enqueues.

This patch makes DSW gracefully handle oversized enqueue bursts.

Fixes: 1c8e3caa3bfb ("event/dsw: add event scheduling and device start/stop")
Cc: stable@dpdk.org
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
drivers/event/dsw/dsw_event.c