From patchwork Thu Aug 17 04:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130449 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 A2A014308A; Thu, 17 Aug 2023 06:28:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4AA742D12; Thu, 17 Aug 2023 06:28:26 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 6002E40685 for ; Thu, 17 Aug 2023 06:28:25 +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 D8A0E62E32; Thu, 17 Aug 2023 04:28:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED767C433CA; Thu, 17 Aug 2023 04:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246504; bh=MeqaHLsgyOCmbkOFKp4YG/K/QFKBLqNQoH675GL+3s0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVC/pe1InXeQlL5/Ik6yQdbBdqB5rH6OlGgJmTUrMwYCea2hDilNsJNzUNmbQH26L Nl1E+PTn3txATQ4EJMEGIM7s9d7lYokRC/xr5Od77R/VFwUHMRBFW4ooDVBo020Rd+ dgxhnX8cKa3mwZx2rispVWUVdJl/MWIQiySXtOaiZepapY+k6EmVNa5c/L+K1Se1CS DVsMNAtCQ0FvsHxHuv1mqI3I2zzNYM6zCukhMSlB0pERfMl8EzFSC760fo7NCaL2qO ox4XKA5comZMh6FlJfgbLSu/KOjePu/u8YWSLSMWD+j7HS3x5RoQTXRVu6CIESR8aT Ni4KnQLgoHFIQ== From: okaya@kernel.org To: Cc: dev@dpdk.org, Stephen Hemminger , Sinan Kaya Subject: [PATCH v5 01/10] eal: cleanup plugins data Date: Thu, 17 Aug 2023 00:28:12 -0400 Message-Id: <20230817042820.137957-2-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 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: Stephen Hemminger When rte_eal_cleanup is called walk through the list of shared objects loaded, and close them and free the data structure. Signed-off-by: Stephen Hemminger Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_options.c | 14 ++++++++++++++ lib/eal/common/eal_options.h | 1 + lib/eal/linux/eal.c | 2 ++ 3 files changed, 17 insertions(+) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index 062f1d8d9c..a509adc78b 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -244,6 +244,20 @@ eal_save_args(int argc, char **argv) } #endif +void +eal_plugins_cleanup(void) +{ +#ifndef RTE_EXEC_ENV_WINDOWS + struct shared_driver *solib, *tmp; + + RTE_TAILQ_FOREACH_SAFE(solib, &solib_list, next, tmp) { + if (solib->lib_handle) + dlclose(solib->lib_handle); + free(solib); + } +#endif +} + static int eal_option_device_add(enum rte_devtype type, const char *optarg) { diff --git a/lib/eal/common/eal_options.h b/lib/eal/common/eal_options.h index 3cc9cb6412..ddbaafc4f1 100644 --- a/lib/eal/common/eal_options.h +++ b/lib/eal/common/eal_options.h @@ -105,6 +105,7 @@ int eal_check_common_options(struct internal_config *internal_cfg); void eal_common_usage(void); enum rte_proc_type_t eal_proc_type_detect(void); int eal_plugins_init(void); +void eal_plugins_cleanup(void); int eal_save_args(int argc, char **argv); int handle_eal_info_request(const char *cmd, const char *params __rte_unused, struct rte_tel_data *d); diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index c6efd92014..dee649bab3 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1398,6 +1398,8 @@ rte_eal_cleanup(void) eal_trace_fini(); eal_mp_dev_hotplug_cleanup(); rte_eal_alarm_cleanup(); + eal_plugins_cleanup(); + /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); rte_eal_malloc_heap_cleanup(); From patchwork Thu Aug 17 04:28:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130450 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 E0D054308A; Thu, 17 Aug 2023 06:28:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 432FA43255; Thu, 17 Aug 2023 06:28:28 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 07D79410D0 for ; Thu, 17 Aug 2023 06:28:26 +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 837016223B; Thu, 17 Aug 2023 04:28:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91ADBC433C7; Thu, 17 Aug 2023 04:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246504; bh=drsxSYaV6CJdVj+UhRmqanGWFmJPiASwKp5SHSCp/WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBd+R9VWtyb3VjpQq0nYpuSw8aLGJVDq6edDqb3VHIsENnsQDE2Hwi22HYAmTUdD4 8wSEcadLWPg6IZqwC3KLGNlcox5XyM1SBgKCVjs8tsjF4AoLGxCV3MfVU9/myCkQdd xjzuPANM/d5ldwup7zBdlshTxd7wfIQQhHRpiRlthwlhfQSC9L8r0tCNbWTOjY2X5p WkD5zuL1Z3Ua1nO3B/d3qoE6vfCgc9vA/jioVa7DHtQO2C0FgVpDzx5GdG748toSgc Nj62Am4q5MYMvkvlSGBgk8h54czR2SaIxaXZWRNMGphFjNQJuWjpxuktjYhoMz4HWQ gHyv2j6vp0s/g== From: okaya@kernel.org To: Cc: dev@dpdk.org, Graham Whyte , Sinan Kaya Subject: [PATCH v5 02/10] eal: fixes for re-initialization issues Date: Thu, 17 Aug 2023 00:28:13 -0400 Message-Id: <20230817042820.137957-3-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 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: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off-by: Graham Whyte --- lib/eal/common/eal_common_options.c | 7 +++++++ lib/eal/linux/eal.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index a509adc78b..630d06f918 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -256,6 +256,13 @@ eal_plugins_cleanup(void) free(solib); } #endif + + /* Reinitialize solib_list */ + TAILQ_INIT(&solib_list); + + main_lcore_parsed = 0; + mem_parsed = 0; + core_parsed = 0; } static int diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index dee649bab3..584c78e640 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -79,6 +79,8 @@ struct lcore_config lcore_config[RTE_MAX_LCORE]; int rte_cycles_vmware_tsc_map; +static uint32_t run_once; + int eal_clean_runtime_dir(void) { @@ -505,6 +507,7 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg) socket_arg[i] = val; } + __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED); return 0; } @@ -967,7 +970,6 @@ int rte_eal_init(int argc, char **argv) { int i, fctret, ret; - static uint32_t run_once; uint32_t has_run = 0; char cpuset[RTE_CPU_AFFINITY_STR_LEN]; char thread_name[RTE_MAX_THREAD_NAME_LEN]; From patchwork Thu Aug 17 04:28:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130451 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 A499A4308A; Thu, 17 Aug 2023 06:28:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85AA84325E; Thu, 17 Aug 2023 06:28:29 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 83340410D0 for ; Thu, 17 Aug 2023 06:28:26 +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 0DBCA63598 for ; Thu, 17 Aug 2023 04:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31FA3C433CA; Thu, 17 Aug 2023 04:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246505; bh=P2glLqiw0cUHcsK6See6IMrndxeGT2hiA71Vv1o5lZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwIaLEQnzlw5FMhfj2go/2IPbWGyCU96BeJOXIienGneQg+BeIMpaCNhWkbrckZD9 NU4BPLYTJJPFq96aOJmc2+Lk+gWSUFtZgixtWYYmkgKuMnsA6yI76Q790F2SIW/ozr U6W/m3oOy8IdAnvgoVtzofOgoJ1ey1DMZW7qbpZn7TP701JfD4csffjdInFIDzHg6f EocD3kCvH1ttyi3Cv7/l1/4ObXeE2t4o4gkjdvcw851sXGTHja5invhrZ/5/O+FnzU IgLP7x/YouS7BIPdAkqpJSx88AicRT7foC65MBhEjw5vwieL7ZYnSCcHX5+MizrZrh jua5lYyKudYFg== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 03/10] tailq: skip init if already initialized Date: Thu, 17 Aug 2023 00:28:14 -0400 Message-Id: <20230817042820.137957-4-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 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 Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c index 580fbf24bc..75c0235438 100644 --- a/lib/eal/common/eal_common_tailqs.c +++ b/lib/eal/common/eal_common_tailqs.c @@ -73,9 +73,10 @@ rte_eal_tailq_create(const char *name) strlcpy(head->name, name, sizeof(head->name) - 1); TAILQ_INIT(&head->tailq_head); rte_tailqs_count++; + return head; } - return head; + return rte_eal_tailq_lookup(name); } /* local register, used to store "early" tailqs before rte_eal_init() and to @@ -99,7 +100,9 @@ rte_eal_tailq_update(struct rte_tailq_elem *t) { if (rte_eal_process_type() == RTE_PROC_PRIMARY) { /* primary process is the only one that creates */ - t->head = rte_eal_tailq_create(t->name); + t->head = rte_eal_tailq_lookup(t->name); + if (t->head == NULL) + t->head = rte_eal_tailq_create(t->name); } else { t->head = rte_eal_tailq_lookup(t->name); } @@ -108,15 +111,13 @@ rte_eal_tailq_update(struct rte_tailq_elem *t) int rte_eal_tailq_register(struct rte_tailq_elem *t) { - if (rte_eal_tailq_local_register(t) < 0) { - RTE_LOG(ERR, EAL, - "%s tailq is already registered\n", t->name); - goto error; - } + rte_eal_tailq_local_register(t); /* if a register happens after rte_eal_tailqs_init(), then we can update * tailq head */ if (rte_tailqs_count >= 0) { + RTE_LOG(INFO, EAL, + "%s tailq is registered\n", t->name); rte_eal_tailq_update(t); if (t->head == NULL) { RTE_LOG(ERR, EAL, @@ -138,6 +139,11 @@ rte_eal_tailqs_init(void) { struct rte_tailq_elem *t; + if (rte_tailqs_count > 0) { + RTE_LOG(INFO, EAL, "tailq already initialized\n"); + return 0; + } + rte_tailqs_count = 0; TAILQ_FOREACH(t, &rte_tailq_elem_head, next) { From patchwork Thu Aug 17 04:28:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130452 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 201BF4308A; Thu, 17 Aug 2023 06:28:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B4C043260; Thu, 17 Aug 2023 06:28:30 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 37167410D0 for ; Thu, 17 Aug 2023 06:28:27 +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 A4E086359E; Thu, 17 Aug 2023 04:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B57B3C433C7; Thu, 17 Aug 2023 04:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246506; bh=kQPdVXV3lWVo3QccrFQe9GkdRIaGrSM4PE0efcAjE70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l6LOwSo9mB67/HqCXwQEvVUC9dF6mSe9w4d8nU7OGMItPqYP8H66tUoPB1DeZ8dOO O22qZhms1J43F9LlZyqXlPN5YBO79XN9x7Cg+dUaugOTXddgxAqK7hQTsyMv3eH9zO 8IakjehDyo3rL0KBN9tuhEhnx7GabG3uCZ0Owbg+LeGbYqDPj+2htenf5agkWrjlq9 rNcBdjTxac9//4ug+v50I5DQ5imRFq64kaabsguEOakCAIfoGVjTD1GQ1feggruIJj d/ysYwVknK2MQ7k7sakzIYtbIzHSFZ+ZleWUDCRqCLoYwQ1JOtvi2EBDdLvRZJ/rr2 Hu44kpFVee8bg== From: okaya@kernel.org To: Anatoly Burakov Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 04/10] eal_memzone: bail out on initialized Date: Thu, 17 Aug 2023 00:28:15 -0400 Message-Id: <20230817042820.137957-5-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 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 memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c index 1f3e701499..d2fac4be01 100644 --- a/lib/eal/common/eal_common_memzone.c +++ b/lib/eal/common/eal_common_memzone.c @@ -425,6 +425,10 @@ rte_eal_memzone_init(void) { struct rte_mem_config *mcfg; int ret = 0; + static bool run_once; + + if (run_once) + return 0; /* get pointer to global configuration */ mcfg = rte_eal_get_configuration()->mem_config; @@ -444,6 +448,8 @@ rte_eal_memzone_init(void) rte_rwlock_write_unlock(&mcfg->mlock); + run_once = true; + return ret; } From patchwork Thu Aug 17 04:28:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130453 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 1C4204308A; Thu, 17 Aug 2023 06:28:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8FB143267; Thu, 17 Aug 2023 06:28:31 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id B506F410D0 for ; Thu, 17 Aug 2023 06:28:27 +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 448F862E32; Thu, 17 Aug 2023 04:28:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 596E6C433CA; Thu, 17 Aug 2023 04:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246506; bh=LCgNRWw+NaeAfKr+FygHvSDIdvxdtFfV8NTcZlsfUXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y25EXjRjgDNXhnhT1U+mYkb1E5lTri+h7yq//FTJAjdqOLzURpeBTHXuMt/a3DJrC hRnpt+4ieD/R0Ddlf0eDcpoPw/oOVnba78EranH6sG69/TYxt5CuBfh9cfCQJdQ75X ll3YSAYBtRKUMR2010Ivo+GZ+QOVa8gHRpTkHTA4uYKW5alj5BuZv5adr8wmKJVZ0N Osn8kNthHxJ5xnV3DyPJfWGUWpkSOjcHCWLGpHJTwQ+bdMDBZ/JngDUHz8XyAVmt5g 9TAfe6LszsL/wE/kAhC7zMHPaIbuX9/tH3nnGlXz5c91By5pm4Ql9WU4MZnGcWL4AP ZxwbaFiZjUX3A== From: okaya@kernel.org To: Anatoly Burakov Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 05/10] memseg: init once Date: Thu, 17 Aug 2023 00:28:16 -0400 Message-Id: <20230817042820.137957-6-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 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 memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 9b6f08fba8..693a56649b 100644 --- a/lib/eal/linux/eal_memory.c +++ b/lib/eal/linux/eal_memory.c @@ -1920,6 +1920,11 @@ rte_eal_memseg_init(void) { /* increase rlimit to maximum */ struct rlimit lim; + int ret; + static bool run_once; + + if (run_once) + return 0; #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES const struct internal_config *internal_conf = @@ -1948,11 +1953,16 @@ rte_eal_memseg_init(void) } #endif - return rte_eal_process_type() == RTE_PROC_PRIMARY ? + ret = rte_eal_process_type() == RTE_PROC_PRIMARY ? #ifndef RTE_ARCH_64 memseg_primary_init_32() : #else memseg_primary_init() : #endif memseg_secondary_init(); + + if (!ret) + run_once = true; + + return ret; } From patchwork Thu Aug 17 04:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130454 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 EC6A84308A; Thu, 17 Aug 2023 06:29:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A0B74324E; Thu, 17 Aug 2023 06:28:33 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 678DF43259 for ; Thu, 17 Aug 2023 06:28:28 +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 E8D05619BF; Thu, 17 Aug 2023 04:28:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04539C433C9; Thu, 17 Aug 2023 04:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246507; bh=OXNlVatoTAEiGwl0ebmeGaLh2BTIaoaMpzWHCOXaN7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lCZbDGdHWKM7GE8h+SqI6fSzfNkOpjG48pQAIKchGJhglMLT+kSBDaYaTYUdvENJi ytlQbjRIIKGpHAP0T35mnzqQygbKbJgcnJAVC/zXKBsFfElLjf9v+4B30WzlfTSS+q S6s0307qZvevk90L3iAIVqje3LiaOceilK31pGlHjCPdiJPjsCPpQDI0MFqmxbT6gO y91xfB0nY/UTX9kaA+4rCLQed9Eypn150/1EgA/DkwiKYL+cyzOUzv6HdZs4z9BMEl s/dqsiGwkwiqO/GNcLfC8CDJKFl0/IhQibOOuaSVPFZd5atKDv5qVgoSvcQD0a8nKv k5p1AqKVEPYOQ== From: okaya@kernel.org To: Anatoly Burakov Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 06/10] eal_memory: skip initialization Date: Thu, 17 Aug 2023 00:28:17 -0400 Message-Id: <20230817042820.137957-7-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 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 heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 6 ++++++ lib/eal/common/malloc_heap.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c index d9433db623..1ba2007f76 100644 --- a/lib/eal/common/eal_common_memory.c +++ b/lib/eal/common/eal_common_memory.c @@ -1083,6 +1083,10 @@ rte_eal_memory_init(void) const struct internal_config *internal_conf = eal_get_internal_configuration(); int retval; + static bool run_once; + + if (run_once) + return 0; RTE_LOG(DEBUG, EAL, "Setting up physically contiguous memory...\n"); @@ -1101,6 +1105,8 @@ rte_eal_memory_init(void) if (internal_conf->no_shconf == 0 && rte_eal_memdevice_init() < 0) goto fail; + run_once = true; + return 0; fail: return -1; diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c index 6b6cf9174c..5f01735520 100644 --- a/lib/eal/common/malloc_heap.c +++ b/lib/eal/common/malloc_heap.c @@ -31,6 +31,7 @@ #define CONST_MAX(a, b) (a > b ? a : b) /* RTE_MAX is not a constant */ #define EXTERNAL_HEAP_MIN_SOCKET_ID (CONST_MAX((1 << 8), RTE_MAX_NUMA_NODES)) + static unsigned check_hugepage_sz(unsigned flags, uint64_t hugepage_sz) { @@ -1409,6 +1410,10 @@ rte_eal_malloc_heap_init(void) unsigned int i; const struct internal_config *internal_conf = eal_get_internal_configuration(); + static bool run_once; + + if (run_once) + return 0; if (internal_conf->match_allocations) RTE_LOG(DEBUG, EAL, "Hugepages will be freed exactly as allocated.\n"); @@ -1435,6 +1440,8 @@ rte_eal_malloc_heap_init(void) return -1; } + run_once = true; + return 0; } From patchwork Thu Aug 17 04:28:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130455 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 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 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; } From patchwork Thu Aug 17 04:28:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130456 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 6D0164308A; Thu, 17 Aug 2023 06:29:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D062C43273; Thu, 17 Aug 2023 06:28:35 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 9AEB543260 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 2A50162E32 for ; Thu, 17 Aug 2023 04:28:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45063C433C8; Thu, 17 Aug 2023 04:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246508; bh=GzdZY5BWZC5AIM3DNvKug6teVg99pRVvPOQuNBaih7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZGyO4JkhhVydO9gEtKXYMLr8lq+Y4VIkrL5UzFTK0wz6U/zuYhRjZrNbulEYzHe/W KuzITpAc4+sL9XFSC12fEPPAN3a0c0N8dK0lfWBEMCW9gujwLCX9lH0sMWdvHBJXct 5UT4oTwmDBSEwS2DQkF7MLGAz7r5bPWypU/zlfKo0U2bAAvjzvYpXeC2vgANqpteEU 3xSOu7lr2sdQH+qjSfjvCOryHI66vExFEHCzvHI8mHGftnLhNsov5r9wN+BGQv2Or8 sIzEf+4kyAFauZ9FP7YPbaJAiyhoGQz5Crga8AJwOt9tbT73mZiEP3QLdUh31f8OEZ VJTwjeJqOWp3Q== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 08/10] eal: initialize worker threads once Date: Thu, 17 Aug 2023 00:28:19 -0400 Message-Id: <20230817042820.137957-9-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 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 worker threads once and keep a flag for other init calls. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 60 ++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 584c78e640..1305e1df54 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -80,6 +80,7 @@ int rte_cycles_vmware_tsc_map; static uint32_t run_once; +static bool worker_initialized; int eal_clean_runtime_dir(void) @@ -1254,42 +1255,45 @@ rte_eal_init(int argc, char **argv) config->main_lcore, (uintptr_t)pthread_self(), cpuset, ret == 0 ? "" : "..."); - RTE_LCORE_FOREACH_WORKER(i) { + if (worker_initialized == false) { + RTE_LCORE_FOREACH_WORKER(i) { /* * create communication pipes between main thread * and children */ - if (pipe(lcore_config[i].pipe_main2worker) < 0) - rte_panic("Cannot create pipe\n"); - if (pipe(lcore_config[i].pipe_worker2main) < 0) - rte_panic("Cannot create pipe\n"); - - lcore_config[i].state = WAIT; - - /* create a thread for each lcore */ - ret = eal_worker_thread_create(i); - if (ret != 0) - rte_panic("Cannot create thread\n"); - - /* Set thread_name for aid in debugging. */ - snprintf(thread_name, sizeof(thread_name), - "rte-worker-%d", i); - rte_thread_set_name(lcore_config[i].thread_id, thread_name); + if (pipe(lcore_config[i].pipe_main2worker) < 0) + rte_panic("Cannot create pipe\n"); + if (pipe(lcore_config[i].pipe_worker2main) < 0) + rte_panic("Cannot create pipe\n"); + + lcore_config[i].state = WAIT; + + /* create a thread for each lcore */ + ret = eal_worker_thread_create(i); + if (ret != 0) + rte_panic("Cannot create thread\n"); + + /* Set thread_name for aid in debugging. */ + snprintf(thread_name, sizeof(thread_name), + "rte-worker-%d", i); + rte_thread_set_name(lcore_config[i].thread_id, thread_name); + + ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id, + &lcore_config[i].cpuset); + if (ret != 0) + rte_panic("Cannot set affinity\n"); + } - ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id, - &lcore_config[i].cpuset); - if (ret != 0) - rte_panic("Cannot set affinity\n"); + /* + * Launch a dummy function on all worker lcores, so that main lcore + * knows they are all ready when this function returns. + */ + rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN); + rte_eal_mp_wait_lcore(); + worker_initialized = true; } - /* - * Launch a dummy function on all worker lcores, so that main lcore - * knows they are all ready when this function returns. - */ - rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN); - rte_eal_mp_wait_lcore(); - /* initialize services so vdevs register service during bus_probe. */ ret = rte_service_init(); if (ret) { From patchwork Thu Aug 17 04:28:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130457 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 C643E4308A; Thu, 17 Aug 2023 06:29:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1247F43275; Thu, 17 Aug 2023 06:28: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 E301243261 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 A9CB0619BF for ; Thu, 17 Aug 2023 04:28:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D18DAC433CA; Thu, 17 Aug 2023 04:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246509; bh=xGiN+ZQQkb7KO9tfzNRbT96N4OAfikuDuzqfaiDb67E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MvPINgS1yG2xaObod3qdWogtW+tVQp1hWuvy6OqDijqDmaL4/miOah4+olMqoqzEQ 1/JXU6Ic8sS7jfHnzY0UEq/2wRiTp7olM8aO1KE/6rbFysc1IHMQ+cNO1HEr820yxr S0Cor2C/Xbe55LzocNIwcrT+4c4tnR8eGw+ChKeh6EMlXgWqHRcbagqyVUeA+8zD7r 3CcJXf9K5JeWw/gdrfjiKxN7tnSvShSDTM/qAPRvqvOQf0rz2juF9G+O2hQf22M0Qb z6M9koWdtlI6jZHpoGCRXl+MGfgDM03l03g2A+Y8v+svuzVmsPfGi8Q/xHdj+ctfac TnAIYh+dn8P5A== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 09/10] eal: declare the reinit via cleanup/init feature unsupported Date: Thu, 17 Aug 2023 00:28:20 -0400 Message-Id: <20230817042820.137957-10-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 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 Call of rte_eal_init() api after rte_eal_cleanup() possible for certain application types but this is not an officially supported feature. Signed-off-by: Sinan Kaya --- lib/eal/include/rte_eal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h index 53c4a5519e..348b340f00 100644 --- a/lib/eal/include/rte_eal.h +++ b/lib/eal/include/rte_eal.h @@ -67,6 +67,11 @@ int rte_eal_iopl_init(void); * as possible in the application's main() function. * It puts the WORKER lcores in the WAIT state. * + * @warning + * It maybe possisble to call it again after rte_eal_cleanup(). + * But this usage is dependent on libraries and drivers support which + * may not work. Use at your own risk. + * * @param argc * A non-negative value. If it is greater than 0, the array members * for argv[0] through argv[argc] (non-inclusive) shall contain pointers From patchwork Thu Aug 17 04:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 130458 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 A60614308A; Thu, 17 Aug 2023 06:30:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94819411F3; Thu, 17 Aug 2023 06:30:40 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id F063F40ED8 for ; Thu, 17 Aug 2023 06:30:33 +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 5EDA96359E for ; Thu, 17 Aug 2023 04:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58FBBC433C8; Thu, 17 Aug 2023 04:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692246632; bh=/hMLz26N7Y7WYFEjwSMir6/cOzErURmJXPxoqo0Sn1s=; h=From:To:Cc:Subject:Date:From; b=NeYKP7icPN2pjMFsbZkdg3VsQp7088REoDt35Qk8NMvBLxpaUXcukscmn/av1bh6p l4A2nZUEZqTp8XEyOpdZUPSIF82J5NmIZSJyK9Dl3U+td/BGnQ1L6MqwB4ESGyu7gO llhpFGndDET9KY06AngGe8DuqPtCy/vPDDXJNX40XGVtNpNNi1S2PbZVTiLQRQUrxu PIYfqp0tAGTj3QtiPffsQlPv2D+40TZYtlAZVu7/5r01LYsWl7uyoS247bX/tuXegl XK/HdKWn713Y/oTQWpPqFn9xbqVk4BoCSFBtDGar/0DjYDm5HPUrwtgpAYuKiyH79Q y22CnUg9e9hXg== From: okaya@kernel.org To: Cc: dev@dpdk.org, Sinan Kaya Subject: [PATCH v5 10/10] test: remove double registration check Date: Thu, 17 Aug 2023 00:30:27 -0400 Message-Id: <20230817043027.138473-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 Code will fetch the existing registration when called for second time as part of the reinit changes. Registration will still succeed. Signed-off-by: Sinan Kaya --- app/test/test_tailq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/test/test_tailq.c b/app/test/test_tailq.c index 9520219b0a..fbb483ea86 100644 --- a/app/test/test_tailq.c +++ b/app/test/test_tailq.c @@ -70,11 +70,6 @@ test_tailq_create(void) if (strcmp(rte_dummy_dyn2_tailq.name, rte_dummy_dyn_tailq.name)) do_return("Error, something is wrong in the tailq test\n"); - /* try allocating again, and check for failure */ - if (!rte_eal_tailq_register(&rte_dummy_dyn2_tailq)) - do_return("Error, registering the same tailq %s did not fail\n", - rte_dummy_dyn2_tailq.name); - return 0; }