[dpdk-dev,v3,2/3] eventdev: extend queue attribute get function

Message ID 1508780456-27837-2-git-send-email-pbhagavatula@caviumnetworks.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

Pavan Nikhilesh Oct. 23, 2017, 5:40 p.m. UTC
  From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

Add schedule type queue attribute so that it can be queried along with
the queue config structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v2 changes:
  - return EOVERFLOW when schedule_type is requested and event_queue_cfg is set
  to *ALL_TYPES*.

 lib/librte_eventdev/rte_eventdev.c | 6 ++++++
 lib/librte_eventdev/rte_eventdev.h | 7 +++++++
 2 files changed, 13 insertions(+)

--
2.7.4
  

Comments

Van Haaren, Harry Oct. 25, 2017, 1:43 p.m. UTC | #1
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, October 23, 2017 6:41 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get
> function
> 
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> 
> Add schedule type queue attribute so that it can be queried along with
> the queue config structure.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> 
>  v2 changes:
>   - return EOVERFLOW when schedule_type is requested and event_queue_cfg is
> set
>   to *ALL_TYPES*.
> 
>  lib/librte_eventdev/rte_eventdev.c | 6 ++++++
>  lib/librte_eventdev/rte_eventdev.h | 7 +++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/lib/librte_eventdev/rte_eventdev.c
> b/lib/librte_eventdev/rte_eventdev.c
> index db96552..fa18422 100644
> --- a/lib/librte_eventdev/rte_eventdev.c
> +++ b/lib/librte_eventdev/rte_eventdev.c
> @@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
> queue_id, uint32_t attr_id,
>  	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
>  		*attr_value = conf->event_queue_cfg;
>  		break;
> +	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
> +		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
> +			return -EOVERFLOW;

I think event_queue_cfg is a bit-set right? The == on this line above is a bug in that case, should be &

<snip>

With above comments;

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
  
Pavan Nikhilesh Oct. 25, 2017, 1:58 p.m. UTC | #2
On Wed, Oct 25, 2017 at 01:43:08PM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Monday, October 23, 2017 6:41 PM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> > jerin.jacob@caviumnetworks.com
> > Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get
> > function
> >
> > From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> >
> > Add schedule type queue attribute so that it can be queried along with
> > the queue config structure.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > ---
> >
> >  v2 changes:
> >   - return EOVERFLOW when schedule_type is requested and event_queue_cfg is
> > set
> >   to *ALL_TYPES*.
> >
> >  lib/librte_eventdev/rte_eventdev.c | 6 ++++++
> >  lib/librte_eventdev/rte_eventdev.h | 7 +++++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_eventdev/rte_eventdev.c
> > b/lib/librte_eventdev/rte_eventdev.c
> > index db96552..fa18422 100644
> > --- a/lib/librte_eventdev/rte_eventdev.c
> > +++ b/lib/librte_eventdev/rte_eventdev.c
> > @@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
> > queue_id, uint32_t attr_id,
> >  	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
> >  		*attr_value = conf->event_queue_cfg;
> >  		break;
> > +	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
> > +		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
> > +			return -EOVERFLOW;
>
> I think event_queue_cfg is a bit-set right? The == on this line above is a bug in that case, should be &
>
Good catch, will send out a v4.
> <snip>
>
> With above comments;
>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Thanks,
Pavan
  

Patch

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index db96552..fa18422 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -809,6 +809,12 @@  rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
 		*attr_value = conf->event_queue_cfg;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
+		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
+			return -EOVERFLOW;
+
+		*attr_value = conf->schedule_type;
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index fa16f82..b9d1b98 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -632,6 +632,10 @@  rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The cfg flags for the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
+/**
+ * The schedule type of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4

 /**
  * Get an attribute from a queue.
@@ -645,6 +649,9 @@  rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * @retval 0 Successfully returned value
  *         -EINVAL invalid device, queue or attr_id provided, or attr_value
  *         was NULL
+ *         -EOVERFLOW returned when attr_id is set to
+ *         RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE and event_queue_cfg is set to
+ *         RTE_EVENT_QUEUE_CFG_ALL_TYPES
  */
 int
 rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,