From 5a11b68ca6a962c983993e1dfdba9f71a1efa6d2 Mon Sep 17 00:00:00 2001 From: Kevan Rehm Date: Tue, 20 Feb 2024 15:16:27 -0600 Subject: [PATCH] libibverbs: ignore IBV_FORK_SAFE et.al. when kernel has fork support ibv_fork_init will now check if IBV_FORK_UNNEEDED is true, and if so will skip initialization of mm_root. Environment variables like IBV_FORK_SAFE and UCX_IB_FORK_INIT are silently ignored when the kernel has the necessary fork support. Signed-off-by: Kevan Rehm --- libibverbs/memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libibverbs/memory.c b/libibverbs/memory.c index 0ca38fc63..c9821e664 100644 --- a/libibverbs/memory.c +++ b/libibverbs/memory.c @@ -134,6 +134,9 @@ int ibv_fork_init(void) if (mm_root) return 0; + if (ibv_is_fork_initialized() == IBV_FORK_UNNEEDED) + return 0; + if (too_late) return EINVAL;