Some PMDs deliver the Rx interrupts of several queues through a single
shared fd; dpaa2, for instance, uses one QBMan portal per lcore.
Registering the fd a second time then returns -EEXIST, which
event_register() treated as fatal and disabled interrupt mode for the
whole lcore.

Accept -EEXIST as success. NICs with a dedicated fd per queue never
return it, so their behaviour is unchanged.

Signed-off-by: Maxime Leroy <[email protected]>
---
 examples/l3fwd-power/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 4874a55de1..fa64e28e5c 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -937,7 +937,12 @@ static int event_register(struct lcore_conf *qconf)
                                                RTE_EPOLL_PER_THREAD,
                                                RTE_INTR_EVENT_ADD,
                                                (void *)((uintptr_t)data));
-               if (ret)
+               /*
+                * Queues polled on the same lcore may share one interrupt fd,
+                * so registering the second onward returns -EEXIST; treat it
+                * as success.
+                */
+               if (ret && ret != -EEXIST)
                        return ret;
        }
 
-- 
2.43.0

Reply via email to