Message ID | 20230815013826.1288972-1-okaya@kernel.org (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 246C043067; Tue, 15 Aug 2023 03:38:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9C23427E9; Tue, 15 Aug 2023 03:38:37 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 2D3EC41104 for <dev@dpdk.org>; Tue, 15 Aug 2023 03:38:36 +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 6B1066133D for <dev@dpdk.org>; Tue, 15 Aug 2023 01:38:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84648C433C8; Tue, 15 Aug 2023 01:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692063514; bh=NlyZhH6RR5dRBRFZctARSeLp8SIz+eMrW+wa3oYxGNM=; h=From:To:Cc:Subject:Date:From; b=mKAN7GnDAl7JmNdpSbqi/2z22amzrcgWqueDoDtNhqWexa8EVcPwHgZIFdkF1c1p3 JHVKziQwR3vtbpNdZC5PvXMEoJCNtGBh+IMz9yf7Z9xvm7BQ7F8Uh0B0/xaxxZXI+c 0h54gM1whdjUJPW01Rq0CMkWNjW8EBnyy1b+JVHkPkX5PL/GIBWGR786K7KQQO31oV rFDxryxKAMwULSbg9mojCshkstIyO3juwsb4caxtcFGqXPbKyucNMgWYesRlUJTFGJ +h5hDhIYjBp5UqzPaImzf3rz8G8QgMo3WkpHtgAok0/PPjYVfAGa1MKo8zk1/LHgyK 2xTziXkKQjz/g== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya <okaya@kernel.org> Subject: [PATCH v1 0/7] support reinit flow Date: Mon, 14 Aug 2023 21:38:19 -0400 Message-Id: <20230815013826.1288972-1-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
support reinit flow
|
|
Message
Sinan Kaya
Aug. 15, 2023, 1:38 a.m. UTC
From: Sinan Kaya <okaya@kernel.org>
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.
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 | 6 +++
lib/eal/common/eal_common_options.c | 7 +++
lib/eal/common/eal_common_tailqs.c | 21 ++++++---
lib/eal/common/malloc_heap.c | 6 +++
lib/eal/linux/eal.c | 72 ++++++++++++++++-------------
lib/eal/linux/eal_interrupts.c | 5 ++
lib/eal/linux/eal_memory.c | 11 ++++-
8 files changed, 92 insertions(+), 41 deletions(-)
Comments
On Mon, 14 Aug 2023 21:38:19 -0400 okaya@kernel.org wrote: > From: Sinan Kaya <okaya@kernel.org> > > We want to be able to call rte_eal_init() and rte_eal_cleanup() > APIs back to back for maintanance reasons. Why? This change exposes lots of drivers, API's and other things to untested code paths. If you just want to do a hard restart, maybe just reexecing the same application would be better.
On Mon, 2023-08-14 at 19:12 -0700, Stephen Hemminger wrote: > On Mon, 14 Aug 2023 21:38:19 -0400 > > okaya@kernel.org wrote: > > > > > From: Sinan Kaya <okaya@kernel.org> > > We want to be able to call rte_eal_init() and rte_eal_cleanup() > > APIs back to back for maintanance reasons. > > > Why? > > This change exposes lots of drivers, API's and other things to > untested code paths. > > If you just want to do a hard restart, maybe just reexecing the same > application would > > be better. It is not always ideal to reinitialize a DPDK process. Memory needs to be reinitialized, hugetables need to warm up etc. Given the cost of change is not huge, I believe this will be important contribution for certain application types. Changeset is not doing anything different from what already exists.
On Mon, 14 Aug 2023 21:38:19 -0400 okaya@kernel.org wrote: > From: Sinan Kaya <okaya@kernel.org> > > We want to be able to call rte_eal_init() and rte_eal_cleanup() > APIs back to back for maintanance reasons. One other note: This sequence could only be done by main lcore, and never ever in a signal handler. Do not try and trap signals like abort, bus error, illegal instruction and try to use this for recovery. It is a recipe for failure.