]> git.droids-corp.org - dpdk.git/commitdiff
event/dsw: use maintenance facility
authorMattias Rönnblom <mattias.ronnblom@ericsson.com>
Mon, 1 Nov 2021 18:40:15 +0000 (19:40 +0100)
committerJerin Jacob <jerinj@marvell.com>
Thu, 4 Nov 2021 12:28:07 +0000 (13:28 +0100)
Set the RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, and perform DSW
background tasks on rte_event_maintain() calls.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Tested-by: Richard Eklycke <richard.eklycke@ericsson.com>
Tested-by: Liron Himi <lironh@marvell.com>
doc/guides/eventdevs/dsw.rst
drivers/event/dsw/dsw_evdev.c
drivers/event/dsw/dsw_evdev.h
drivers/event/dsw/dsw_event.c

index 6653f501c10afb6548bc5828add4729eb6d8d1b1..18f7e9588fab19a5c96b81b2985f421c8e9ad527 100644 (file)
@@ -40,20 +40,20 @@ Example:
 Limitations
 -----------
 
-Unattended Ports
+Port Maintenance
 ~~~~~~~~~~~~~~~~
 
-The distributed software eventdev uses an internal signaling schema
-between the ports to achieve load balancing. In order for this to
-work, the application must perform enqueue and/or dequeue operations
-on all ports.
+The distributed software eventdev uses an internal signaling scheme
+between the ports to achieve load balancing. Therefore, it sets the
+``RTE_EVENT_DEV_CAP_REQUIRES_MAINT`` flag.
 
-Producer-only ports which currently have no events to enqueue should
-periodically call rte_event_enqueue_burst() with a zero-sized burst.
+During periods when the application thread using a particular port is
+neither attempting to enqueue nor to dequeue events, it must
+repeatedly call rte_event_maintain() on that port.
 
-Ports left unattended for longer periods of time will prevent load
-balancing, and also cause traffic interruptions on the flows which
-are in the process of being migrated.
+Ports left unmaintained for long periods of time will prevent load
+balancing and cause traffic interruptions on flows which are in the
+process of being migrated.
 
 Output Buffering
 ~~~~~~~~~~~~~~~~
@@ -66,8 +66,11 @@ In case no more events are enqueued on a port with buffered events,
 these events will be sent after the application has performed a number
 of enqueue and/or dequeue operations.
 
-For explicit flushing, an application may call
-rte_event_enqueue_burst() with a zero-sized burst.
+To immediately flush a port's output buffer, an application may call
+rte_event_maintain() with op set to ``RTE_EVENT_DEV_MAINT_OP_FLUSH``.
+
+Repeated calls to rte_event_maintain() will also flush the output
+buffers.
 
 
 Priorities
index 0652d83ad60a66cd2af440671ceb9b32f022516e..5ff8fcc6a9e820229b1c78fb2b9e32ac469513c4 100644 (file)
@@ -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;
index 631daea55cebde21167899d3b04ed6838e3ba719..e64ae26f6e6c7b1870ea99f5a736086ac9c032d9 100644 (file)
@@ -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 op);
 
 int dsw_xstats_get_names(const struct rte_eventdev *dev,
                         enum rte_event_dev_xstats_mode mode,
index 1f098169451e943c289c7acc95f45661cfcaf9b7..c6ed470286060b763548e80dc3b87beab04ade11 100644 (file)
@@ -1400,3 +1400,15 @@ dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num,
 
        return dequeued;
 }
+
+void dsw_event_maintain(void *port, int op)
+{
+       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);
+
+       if (op & RTE_EVENT_DEV_MAINT_OP_FLUSH)
+               dsw_port_flush_out_buffers(dsw, source_port);
+}