[dpdk-dev,v2,4/4] eventdev: add device started attribute
Checks
Commit Message
This commit adds an attribute to the eventdev, allowing applications
to retrieve if the eventdev is running or stopped. Note that no API
or ABI changes were required in adding the statistic, and code changes
are minimal.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
lib/librte_eventdev/rte_eventdev.c | 3 +++
lib/librte_eventdev/rte_eventdev.h | 4 ++++
2 files changed, 7 insertions(+)
@@ -740,6 +740,9 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
case RTE_EVENT_DEV_ATTR_QUEUE_COUNT:
*attr_value = dev->data->nb_queues;
break;
+ case RTE_EVENT_DEV_ATTR_STARTED:
+ *attr_value = dev->data->dev_started;
+ break;
}
return 0;
@@ -695,6 +695,10 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
* The count of queues.
*/
#define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
+/**
+ * The state of the device, returns zero if stopped, non-zero when running.
+ */
+#define RTE_EVENT_DEV_ATTR_STARTED 2
/**
* Get an attribute from a device.