event/sw: fix mapped qid count with parallel queue
authorHarry van Haaren <harry.van.haaren@intel.com>
Wed, 7 Jun 2017 10:04:44 +0000 (11:04 +0100)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Wed, 21 Jun 2017 13:33:22 +0000 (15:33 +0200)
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

index 7f69e38..bc834a9 100644 (file)
@@ -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++;
                }