summaryrefslogtreecommitdiffstats
path: root/drivers/event/sw/sw_evdev_worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/event/sw/sw_evdev_worker.c')
-rw-r--r--drivers/event/sw/sw_evdev_worker.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/event/sw/sw_evdev_worker.c b/drivers/event/sw/sw_evdev_worker.c
index 67151f77..063b919c 100644
--- a/drivers/event/sw/sw_evdev_worker.c
+++ b/drivers/event/sw/sw_evdev_worker.c
@@ -77,8 +77,10 @@ sw_event_enqueue_burst(void *port, const struct rte_event ev[], uint16_t num)
rte_atomic32_add(&sw->inflights, credit_update_quanta);
p->inflight_credits += (credit_update_quanta);
- if (p->inflight_credits < new)
- return 0;
+ /* If there are fewer inflight credits than new events, limit
+ * the number of enqueued events.
+ */
+ num = (p->inflight_credits < new) ? p->inflight_credits : new;
}
for (i = 0; i < num; i++) {