From patchwork Tue Aug 15 03:13:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130319 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 713E643069; Tue, 15 Aug 2023 05:13:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB00F43263; Tue, 15 Aug 2023 05:13:20 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 776B743261 for ; Tue, 15 Aug 2023 05:13:16 +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 E3DDF61320; Tue, 15 Aug 2023 03:13:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1DE1C433CA; Tue, 15 Aug 2023 03:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692069195; bh=GNIPh54KXGxsfa5ki8tVQulezifKMxoDrO5/n63RvGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nI7KP+3RDcAzPePDYU17l1ckfY+LBnYm8qWFaxKaMS2Nd+xCFvNOXeummKd51dd5v A/k8MxV+WlqGkRpRcZgH+msL/MAtfC85H0ssj6d9bsbRtHz3CeD4VpecIGwfiZ3pJR 1Kr5V5G+SA0d7bThjdOkWKAugKrpPsiy1Mnh0LmWHVEU6ZowNHNxm253WJdlLdTXDf Z3es2vdBB1aoDqrAk4wIqdPT3H8m9QcUV8njo26GjT/Y4HIUlgd4sYs16QCWe+2QVE U3+S+u8jaR6lrwON+h/jA5fDWDzz6Ph3scthtyj4i8Us3LtHEPSlSMQdi+2n9ZJVdJ 0/2zoUXNBpr1Q== From: okaya@kernel.org To: Harman Kalra Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v2 6/7] eal_interrupts: don't reinitialize threads Date: Mon, 14 Aug 2023 23:13:06 -0400 Message-Id: <20230815031307.1299726-7-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230815031307.1299726-1-okaya@kernel.org> References: <20230815031307.1299726-1-okaya@kernel.org> MIME-Version: 1.0 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d52ec8eb4c..f141711f12 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -91,6 +91,9 @@ static struct rte_intr_source_list intr_sources; /* interrupt handling thread */ static pthread_t intr_thread; +/* flag for initialization */ +static bool intr_initialized; + /* VFIO interrupts */ #ifdef VFIO_PRESENT @@ -1175,6 +1178,9 @@ rte_eal_intr_init(void) { int ret = 0; + if (intr_initialized) + return 0; + /* init the global interrupt source head */ TAILQ_INIT(&intr_sources); @@ -1196,6 +1202,7 @@ rte_eal_intr_init(void) "Failed to create thread for interrupt handling\n"); } + intr_initialized = true; return ret; }