]> git.droids-corp.org - dpdk.git/commitdiff
eventdev: add device started attribute
authorHarry van Haaren <harry.van.haaren@intel.com>
Wed, 20 Sep 2017 13:36:02 +0000 (14:36 +0100)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Tue, 10 Oct 2017 16:31:30 +0000 (18:31 +0200)
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>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
lib/librte_eventdev/rte_eventdev.c
lib/librte_eventdev/rte_eventdev.h

index 2bf8b6beb86c665eebe7855aee91025f8c977c84..c5db32f69948779d5300bc20520fd8dfb0fb0b39 100644 (file)
@@ -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;
        }
index 97a46af8c4f3652b816c5937a5a240b0aba05a2d..ec7aabd9ae782fe545b1c96ba31d6a0b4dde0238 100644 (file)
@@ -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.