From: Jun Yang <[email protected]>

dpaa2_eventdev_dequeue_wait() cleared the interrupt status and armed
epoll_wait() using the per-lcore portal and DPIO
(DPAA2_PER_LCORE_PORTAL / DPAA2_PER_LCORE_DPIO). Those per-lcore
handles are only valid on the polling path and do not correspond to
the DPIO backing the event port, so the interrupt fd waited on could
belong to the wrong portal.

Pass the event port's dpio_dev into dpaa2_eventdev_dequeue_wait() and
use its software portal and epoll fd, matching the DPIO actually used
by the dequeue burst.

Signed-off-by: Jun Yang <[email protected]>
---
 drivers/event/dpaa2/dpaa2_eventdev.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c 
b/drivers/event/dpaa2/dpaa2_eventdev.c
index 5badc17af7..be23dbf4dc 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -230,15 +230,13 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct 
rte_event ev[],
        return num_tx;
 }
 
-static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks)
+static void dpaa2_eventdev_dequeue_wait(struct dpaa2_dpio_dev *dpio_dev,
+       uint64_t timeout_ticks)
 {
        struct epoll_event epoll_ev;
 
-       qbman_swp_interrupt_clear_status(DPAA2_PER_LCORE_PORTAL,
-                                        QBMAN_SWP_INTERRUPT_DQRI);
-
-       epoll_wait(DPAA2_PER_LCORE_DPIO->epoll_fd,
-                        &epoll_ev, 1, timeout_ticks);
+       qbman_swp_interrupt_clear_status(dpio_dev->sw_portal, 
QBMAN_SWP_INTERRUPT_DQRI);
+       epoll_wait(dpio_dev->epoll_fd, &epoll_ev, 1, timeout_ticks);
 }
 
 static void dpaa2_eventdev_process_parallel(struct dpaa2_dpio_dev *dpio_dev,
@@ -316,7 +314,7 @@ dpaa2_eventdev_dequeue_burst(void *port, struct rte_event 
ev[],
                         */
                        qbman_swp_dqrr_consume(swp, NULL);
                        if (!num_pkts && timeout_ticks) {
-                               dpaa2_eventdev_dequeue_wait(timeout_ticks);
+                               dpaa2_eventdev_dequeue_wait(dpio_dev, 
timeout_ticks);
                                timeout_ticks = 0;
                                continue;
                        }
-- 
2.43.0

Reply via email to