[dpdk-dev,v3,4/4] eventdev: add device started attribute

Message ID 1504885015-44642-5-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Van Haaren, Harry Sept. 8, 2017, 3:36 p.m. UTC
  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(+)
  

Comments

Jerin Jacob Sept. 11, 2017, 5:52 p.m. UTC | #1
-----Original Message-----
> Date: Fri, 8 Sep 2017 16:36:55 +0100
> From: Harry van Haaren <harry.van.haaren@intel.com>
> To: dev@dpdk.org
> CC: jerin.jacob@caviumnetworks.com, Harry van Haaren
>  <harry.van.haaren@intel.com>
> Subject: [PATCH v3 4/4] eventdev: add device started attribute
> X-Mailer: git-send-email 2.7.4
> 
> 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(+)
> 
> diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
> index 3756ec7..87a1e19 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,

I think, the new rte_event_dev_attr_get function, we can move up so that
all device specific functions comes back to back in API documentation.

Check the output of "make doc-api-html"

Other than that, it looks good.

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
  
Van Haaren, Harry Sept. 12, 2017, 8:07 a.m. UTC | #2
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Monday, September 11, 2017 6:53 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v3 4/4] eventdev: add device started attribute
> 
> -----Original Message-----
> > Date: Fri, 8 Sep 2017 16:36:55 +0100
> > From: Harry van Haaren <harry.van.haaren@intel.com>
> > To: dev@dpdk.org
> > CC: jerin.jacob@caviumnetworks.com, Harry van Haaren
> >  <harry.van.haaren@intel.com>
> > Subject: [PATCH v3 4/4] eventdev: add device started attribute
> > X-Mailer: git-send-email 2.7.4
> >
> > 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(+)
> >
> > diff --git a/lib/librte_eventdev/rte_eventdev.c
> b/lib/librte_eventdev/rte_eventdev.c
> > index 3756ec7..87a1e19 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,
> 
> I think, the new rte_event_dev_attr_get function, we can move up so that
> all device specific functions comes back to back in API documentation.
> 
> Check the output of "make doc-api-html"
> 
> Other than that, it looks good.
>
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Thanks for the review - all comments make sense. Will respin with comments addressed, and include Acks.
  

Patch

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 3756ec7..87a1e19 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.