This commit exposes if useful work is done to the service
instance. The normal service_attr_get() API can be used to
retrieve the value of the attribute.

Signed-off-by: Harry van Haaren <harry.van.haa...@intel.com>

---

Cc: jer...@marvell.com
CC due to event/sw change, could be picked up by main tree as depends on 1/2?

 drivers/event/sw/sw_evdev_scheduler.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/event/sw/sw_evdev_scheduler.c 
b/drivers/event/sw/sw_evdev_scheduler.c
index cff747da89..4e932612d5 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
@@ -5,6 +5,9 @@
 #include <rte_ring.h>
 #include <rte_hash_crc.h>
 #include <rte_event_ring.h>
+
+#include <rte_service_component.h>
+
 #include "sw_evdev.h"
 #include "iq_chunk.h"
 
@@ -554,6 +557,10 @@ sw_event_schedule(struct rte_eventdev *dev)
        sw->sched_no_iq_enqueues += (in_pkts_total == 0);
        sw->sched_no_cq_enqueues += (out_pkts_total == 0);
 
+       uint64_t work_done = (in_pkts_total + out_pkts_total) != 0;
+       rte_service_component_attr_set(sw->service_id,
+                       RTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER, work_done);
+
        /* push all the internal buffered QEs in port->cq_ring to the
         * worker cores: aka, do the ring transfers batched.
         */
-- 
2.17.1

Reply via email to