[v2,2/2] event/sw: add useful work done attribute
Checks
Commit Message
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.haaren@intel.com>
---
drivers/event/sw/sw_evdev_scheduler.c | 7 +++++++
1 file changed, 7 insertions(+)
@@ -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.
*/