From patchwork Tue Aug 15 03:52:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 56 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 3DE1943069; Tue, 15 Aug 2023 05:52:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D232442B71; Tue, 15 Aug 2023 05:52:49 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id ECE0D41104 for ; Tue, 15 Aug 2023 05:52:47 +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 4E0DF618F1 for ; Tue, 15 Aug 2023 03:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01D97C433C7; Tue, 15 Aug 2023 03:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692071566; bh=UIrm0yt4DAyI6bNvYlplsglCui+IpLheFo1rxv1I80w=; h=From:To:Cc:Subject:Date:From; b=RqAIjYPf+lI5U6XIqAc6xRctr2e3ai5YKHvW7viGF5Y5x6R/r95hjTzjBMmtOCjeb CQXMlWkwqFZZvQktrpY1ueKkiavbBHf+u+4aNkCfI8MQbbfOz5KEZP/iypYhYUMQsm rHUV4SW1fQGjp2jOaBT0lx1tlNDPUWWJBkpRuU6BYLLjkgJbjAaNtCYF6uCjgeQ88R j9E5D50uh/gd8HPGa0uVZLIqUqv8QHh5zWe7OMjbkURiAjok12JCtioue0oeQl8zgM 7N4uaxRZ30JBacZsRPNBrBb3EytNl/Vau+Zoc0H48f+tZLYPEQuM10ZFszK0pa6nA5 dRDi4oxewTaeA== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v3 0/7] support reinit flow Date: Mon, 14 Aug 2023 23:52:32 -0400 Message-Id: <20230815035239.1365591-1-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 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 We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never clean up after them and don't have a cleanup API. 3. some code assumes that they only get called once during the lifecycle of the process. Most changes in this patch center around following the #1 design principle. Why? It is not always ideal to reinitialize a DPDK process. Memory needs to be reinitialized, hugetables need to warm up etc. Changed from v1: Fix checkpatch warnings v2: rebase to most recent DPDK. Graham Whyte (1): eal: fixes for re-initialization issues Sinan Kaya (6): tailq: skip init if already initialized eal_memzone: bail out on initialized memseg: init once eal_memory: skip initialization eal_interrupts: don't reinitialize threads eal: initialize worker threads once lib/eal/common/eal_common_memory.c | 5 +++ lib/eal/common/eal_common_memzone.c | 7 ++++ lib/eal/common/eal_common_options.c | 7 ++++ lib/eal/common/eal_common_tailqs.c | 20 +++++---- lib/eal/common/malloc_heap.c | 7 ++++ lib/eal/linux/eal.c | 64 ++++++++++++++++------------- lib/eal/linux/eal_interrupts.c | 7 ++++ lib/eal/linux/eal_memory.c | 12 +++++- 8 files changed, 92 insertions(+), 37 deletions(-)