[dpdk-dev] event/sw: fix mapped qid count with parallel queue

Message ID 1496829884-189816-1-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Accepted, 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 June 7, 2017, 10:04 a.m. UTC
  This commit fixes the counting of mapped queues to a port,
when the type of queue type is PARALLEL. Not incrementing
the count here could lead to an underflow of the count when
unlinking at a later date.

Fixes: 371a688fc159 ("event/sw: support linking queues to ports")

Reported-by: Jesse Bruni <jesse.bruni@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/event/sw/sw_evdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob June 20, 2017, 2:11 p.m. UTC | #1
-----Original Message-----
> Date: Wed, 7 Jun 2017 11:04:44 +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] event/sw: fix mapped qid count with parallel queue
> X-Mailer: git-send-email 2.7.4
> 
> This commit fixes the counting of mapped queues to a port,
> when the type of queue type is PARALLEL. Not incrementing
> the count here could lead to an underflow of the count when
> unlinking at a later date.
> 
> Fixes: 371a688fc159 ("event/sw: support linking queues to ports")

Applied to dpdk-next-eventdev/master. Thanks.

> 
> Reported-by: Jesse Bruni <jesse.bruni@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>  drivers/event/sw/sw_evdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> index a31aaa6..235e0cc 100644
> --- a/drivers/event/sw/sw_evdev.c
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -90,7 +90,8 @@ sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],
>  		} else if (q->type == RTE_SCHED_TYPE_ORDERED) {
>  			p->num_ordered_qids++;
>  			p->num_qids_mapped++;
> -		} else if (q->type == RTE_SCHED_TYPE_ATOMIC) {
> +		} else if (q->type == RTE_SCHED_TYPE_ATOMIC ||
> +				q->type == RTE_SCHED_TYPE_PARALLEL) {
>  			p->num_qids_mapped++;
>  		}
>  
> -- 
> 2.7.4
>
  

Patch

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index a31aaa6..235e0cc 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -90,7 +90,8 @@  sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],
 		} else if (q->type == RTE_SCHED_TYPE_ORDERED) {
 			p->num_ordered_qids++;
 			p->num_qids_mapped++;
-		} else if (q->type == RTE_SCHED_TYPE_ATOMIC) {
+		} else if (q->type == RTE_SCHED_TYPE_ATOMIC ||
+				q->type == RTE_SCHED_TYPE_PARALLEL) {
 			p->num_qids_mapped++;
 		}