From: Harry van Haaren Date: Wed, 20 Sep 2017 13:36:02 +0000 (+0100) Subject: eventdev: add device started attribute X-Git-Tag: spdx-start~1626 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=44f3b4a4b50585ea30715ed76d1d2d102db9e5bc;p=dpdk.git eventdev: add device started attribute 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 Acked-by: Jerin Jacob --- diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 2bf8b6beb8..c5db32f699 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -744,6 +744,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; default: return -EINVAL; } diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 97a46af8c4..ec7aabd9ae 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -407,6 +407,10 @@ rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info); * The count of queues. */ #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1 +/** + * The status of the device, zero for stopped, non-zero for started. + */ +#define RTE_EVENT_DEV_ATTR_STARTED 2 /** * Get an attribute from a device.