All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eventdev: use links_map to unlink queues
@ 2017-12-11 15:05 Pavan Nikhilesh
  2017-12-11 17:24 ` Eads, Gage
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:05 UTC (permalink / raw)
  To: gage.eads, jerin.jacob, bruce.richardson, nipun.gupta,
	santosh.shukla, harry.van.haaren, hemant.agrawal
  Cc: dev, Pavan Nikhilesh

The octeontx event device doesn't store the queues to port mapping as a result
it cannot return the exact number of queues unlinked from a port when
application wants to unlink all the queues mapped (supplies queues param as
NULL).

Using links_map we can determine the exact queues mapped to a specific port and
unlink them.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eventdev/rte_eventdev.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index e0c2a78..e17f8fc 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -888,7 +888,8 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
 {
 	struct rte_eventdev *dev;
 	uint8_t all_queues[RTE_EVENT_MAX_QUEUES_PER_DEV];
-	int i, diag;
+	uint8_t linked_queues[RTE_EVENT_MAX_QUEUES_PER_DEV];
+	int i, diag, j;
 	uint16_t *links_map;
 
 	RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0);
@@ -918,6 +919,18 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
 			rte_errno = -EINVAL;
 			return 0;
 		}
+	j = 0;
+	links_map = dev->data->links_map;
+	links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV);
+	for (i = 0; i < nb_unlinks; i++) {
+		if (links_map[queues[i]] !=
+				EVENT_QUEUE_SERVICE_PRIORITY_INVALID) {
+			linked_queues[j] = queues[i];
+			j++;
+		}
+	}
+	queues = linked_queues;
+	nb_unlinks = j;
 
 	diag = (*dev->dev_ops->port_unlink)(dev, dev->data->ports[port_id],
 					queues, nb_unlinks);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-16  9:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 15:05 [PATCH] eventdev: use links_map to unlink queues Pavan Nikhilesh
2017-12-11 17:24 ` Eads, Gage
2017-12-12  7:23   ` Pavan Nikhilesh Bhagavatula
2017-12-12  9:33 ` [PATCH v2] eventdev: use links map " Pavan Nikhilesh
2017-12-12 16:08   ` Eads, Gage
2017-12-12 17:22     ` Pavan Nikhilesh Bhagavatula
2017-12-12 18:58 ` [PATCH v3] " Pavan Nikhilesh
2017-12-16  9:16   ` Jerin Jacob

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.