From patchwork Fri Sep 8 15:18:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 28519 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6176E199DE; Fri, 8 Sep 2017 17:18:15 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CA805199CB for ; Fri, 8 Sep 2017 17:18:11 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Sep 2017 08:18:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,362,1500966000"; d="scan'208";a="147035392" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by orsmga005.jf.intel.com with ESMTP; 08 Sep 2017 08:18:10 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Harry van Haaren Date: Fri, 8 Sep 2017 16:18:14 +0100 Message-Id: <1504883894-43451-5-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504883894-43451-1-git-send-email-harry.van.haaren@intel.com> References: <1500900500-144237-1-git-send-email-harry.van.haaren@intel.com> <1504883894-43451-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v2 4/4] eventdev: add device started attribute X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- lib/librte_eventdev/rte_eventdev.c | 3 +++ lib/librte_eventdev/rte_eventdev.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 85c0960..9ec5d42 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -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; diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index cd3026d..f76d9f9 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -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.