Ensure at least 1 handler is created even if something goes wrong during
cpu detection or prime numer calculation.

Fixes: a5cacea5f988 ("handlers: Create additional handler threads when using 
CPU isolation.")
Cc: [email protected]

Suggested-by: Aaron Conole <[email protected]>
Signed-off-by: Adrian Moreno <[email protected]>
---
 lib/dpif-netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index 7875e573e..ebe7b5cb1 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -2582,7 +2582,7 @@ dpif_netlink_calculate_n_handlers(void)
         n_handlers = MIN(next_prime_num, total_cores);
     }
 
-    return n_handlers;
+    return MAX(n_handlers, 1);
 }
 
 static int
-- 
2.39.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to