From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D36234308A; Thu, 17 Aug 2023 06:29:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97D284326F; Thu, 17 Aug 2023 06:28:34 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 1945F43259 for ; Thu, 17 Aug 2023 06:28:29 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9615963598; Thu, 17 Aug 2023 04:28:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CDDDC433CA; Thu, 17 Aug 2023 04:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246508; bh=5wCOcJdmi48Ee+0iSe3+65dLl1wroNcvgJSKWXxhJHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=go3nJFlTs0lW3OEWnyQpAlZR3wxbwXh60g/cWpmQxY8PTc1rL3G4wba9cOasBRrQ/ W/s9TIa7dlvTxuKY/ZYIEJDE6dp0Ty3XWkUAmvbkp2GucZgNY9uP+Fo4OqyAYjxM3j SxbBwvZVC+5i+DEQl/dNCfgNSRqYkmbC90kaAFYzAgGYp3AgigX0xS9OSYbiU1WM07 BPUnhvY2Atu5DczhXitnSks5lQ54U5COS5Mgc6WD3OFDGw8TUOiAqr/TLGEbTGvb0x kbqoU5G+ELIlxvlRLlMelpJ6kiaKuW2BdHLf9ufVFnVYgFLL45ncGszEtdqb3yxn7I NCHZ5yVF7MnKw== From: okaya@kernel.org To: Harman Kalra Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 07/10] eal_interrupts: don't reinitialize threads Date: Thu, 17 Aug 2023 00:28:18 -0400 Message-Id: <20230817042820.137957-8-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230817042820.137957-1-okaya@kernel.org> References: <20230817042820.137957-1-okaya@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Sinan Kaya Initialize interrupt thread once and keep a flag for further init. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index c9881143be..7adf4076ae 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -1174,6 +1174,10 @@ int rte_eal_intr_init(void) { int ret = 0; + static bool run_once; + + if (run_once) + return 0; /* init the global interrupt source head */ TAILQ_INIT(&intr_sources); @@ -1196,6 +1200,8 @@ rte_eal_intr_init(void) "Failed to create thread for interrupt handling\n"); } + run_once = true; + return ret; } -- 2.25.1