Set the RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, and perform DSW
background tasks on rte_event_maintain() calls.

RFC v2: Have dsw_event_maintain() occasionally flush the port output
        buffers.

Signed-off-by: Mattias Rönnblom <mattias.ronnb...@ericsson.com>
Tested-by: Richard Eklycke <richard.ekly...@ericsson.com>
Tested-by: Liron Himi <lir...@marvell.com>
---
 drivers/event/dsw/dsw_evdev.c | 4 +++-
 drivers/event/dsw/dsw_evdev.h | 1 +
 drivers/event/dsw/dsw_event.c | 9 +++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 0652d83ad6..5ff8fcc6a9 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -222,7 +222,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,
                RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED|
                RTE_EVENT_DEV_CAP_NONSEQ_MODE|
                RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT|
-               RTE_EVENT_DEV_CAP_CARRY_FLOW_ID
+               RTE_EVENT_DEV_CAP_CARRY_FLOW_ID|
+               RTE_EVENT_DEV_CAP_REQUIRES_MAINT
        };
 }
 
@@ -441,6 +442,7 @@ dsw_probe(struct rte_vdev_device *vdev)
        dev->enqueue_forward_burst = dsw_event_enqueue_forward_burst;
        dev->dequeue = dsw_event_dequeue;
        dev->dequeue_burst = dsw_event_dequeue_burst;
+       dev->maintain = dsw_event_maintain;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h
index 631daea55c..31af4ede0f 100644
--- a/drivers/event/dsw/dsw_evdev.h
+++ b/drivers/event/dsw/dsw_evdev.h
@@ -271,6 +271,7 @@ uint16_t dsw_event_enqueue_forward_burst(void *port,
 uint16_t dsw_event_dequeue(void *port, struct rte_event *ev, uint64_t wait);
 uint16_t dsw_event_dequeue_burst(void *port, struct rte_event *events,
                                 uint16_t num, uint64_t wait);
+void dsw_event_maintain(void *port);
 
 int dsw_xstats_get_names(const struct rte_eventdev *dev,
                         enum rte_event_dev_xstats_mode mode,
diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
index 1f09816945..f16d9d463b 100644
--- a/drivers/event/dsw/dsw_event.c
+++ b/drivers/event/dsw/dsw_event.c
@@ -1400,3 +1400,12 @@ dsw_event_dequeue_burst(void *port, struct rte_event 
*events, uint16_t num,
 
        return dequeued;
 }
+
+void dsw_event_maintain(void *port)
+{
+       struct dsw_port *source_port = port;
+       struct dsw_evdev *dsw = source_port->dsw;
+
+       dsw_port_note_op(source_port, 0);
+       dsw_port_bg_process(dsw, source_port);
+}
-- 
2.25.1

Reply via email to