Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/130360/?format=api
http://patchwork.dpdk.org/api/patches/130360/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230815145023.1386003-9-okaya@kernel.org/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20230815145023.1386003-9-okaya@kernel.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230815145023.1386003-9-okaya@kernel.org", "date": "2023-08-15T14:50:23", "name": "[v4,8/8] eal: initialize worker threads once", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "eadaed71f47d3512fe17e6f2557e23ee9d440541", "submitter": { "id": 2903, "url": "http://patchwork.dpdk.org/api/people/2903/?format=api", "name": "Sinan Kaya", "email": "okaya@kernel.org" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230815145023.1386003-9-okaya@kernel.org/mbox/", "series": [ { "id": 29234, "url": "http://patchwork.dpdk.org/api/series/29234/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29234", "date": "2023-08-15T14:50:15", "name": "support reinit flow", "version": 4, "mbox": "http://patchwork.dpdk.org/series/29234/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/130360/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/130360/checks/", "tags": {}, "related": [], "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8C57043073;\n\tTue, 15 Aug 2023 16:51:21 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7A9324327A;\n\tTue, 15 Aug 2023 16:50:42 +0200 (CEST)", "from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])\n by mails.dpdk.org (Postfix) with ESMTP id 107B843269\n for <dev@dpdk.org>; Tue, 15 Aug 2023 16:50:38 +0200 (CEST)", "from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits))\n (No client certificate requested)\n by dfw.source.kernel.org (Postfix) with ESMTPS id 9277561CC0\n for <dev@dpdk.org>; Tue, 15 Aug 2023 14:50:37 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id B31A7C433CA;\n Tue, 15 Aug 2023 14:50:36 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1692111037;\n bh=GzdZY5BWZC5AIM3DNvKug6teVg99pRVvPOQuNBaih7w=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=bxrDLXt/3m9ej50m7GR3oXnTMtTQ7CBZi9hNFpQ3mA9nf1YChnKRQjCH9eACRkSj6\n /mQqDw4u6U3gz0oKEoRk6DwMcaFufXJeFynV2GUKetU4HRJh0DB91le18UK6a22+4o\n oQgsybqEIKNqnPAQ1jCa2xFzQ52+AyMuHQKaUU9lWAx4CMcsWiNZHDNO8vpZoJmF5j\n hl8vjR63jF0zEEDVD7ylRa9daZl0taRFvsKiyG8c75jQQgqpjdLK1YU0rwN1BaOoD/\n ti0MEOLfLaqavVerH/lWkRuvocCk4TfQbSqFtgiXNzLj9UtJF0hl3kYnKnt9v5pawR\n R3WSqKE+R8+rA==", "From": "okaya@kernel.org", "To": "", "Cc": "dev@dpdk.org,\n\tSinan Kaya <okaya@kernel.org>", "Subject": "[PATCH v4 8/8] eal: initialize worker threads once", "Date": "Tue, 15 Aug 2023 10:50:23 -0400", "Message-Id": "<20230815145023.1386003-9-okaya@kernel.org>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230815145023.1386003-1-okaya@kernel.org>", "References": "<20230815145023.1386003-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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "From: Sinan Kaya <okaya@kernel.org>\n\nInitialize worker threads once and keep a flag\nfor other init calls.\n\nSigned-off-by: Sinan Kaya <okaya@kernel.org>\n---\n lib/eal/linux/eal.c | 60 ++++++++++++++++++++++++---------------------\n 1 file changed, 32 insertions(+), 28 deletions(-)", "diff": "diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex 584c78e640..1305e1df54 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -80,6 +80,7 @@ int rte_cycles_vmware_tsc_map;\n \n \n static uint32_t run_once;\n+static bool worker_initialized;\n \n int\n eal_clean_runtime_dir(void)\n@@ -1254,42 +1255,45 @@ rte_eal_init(int argc, char **argv)\n \t\tconfig->main_lcore, (uintptr_t)pthread_self(), cpuset,\n \t\tret == 0 ? \"\" : \"...\");\n \n-\tRTE_LCORE_FOREACH_WORKER(i) {\n+\tif (worker_initialized == false) {\n+\t\tRTE_LCORE_FOREACH_WORKER(i) {\n \n \t\t/*\n \t\t * create communication pipes between main thread\n \t\t * and children\n \t\t */\n-\t\tif (pipe(lcore_config[i].pipe_main2worker) < 0)\n-\t\t\trte_panic(\"Cannot create pipe\\n\");\n-\t\tif (pipe(lcore_config[i].pipe_worker2main) < 0)\n-\t\t\trte_panic(\"Cannot create pipe\\n\");\n-\n-\t\tlcore_config[i].state = WAIT;\n-\n-\t\t/* create a thread for each lcore */\n-\t\tret = eal_worker_thread_create(i);\n-\t\tif (ret != 0)\n-\t\t\trte_panic(\"Cannot create thread\\n\");\n-\n-\t\t/* Set thread_name for aid in debugging. */\n-\t\tsnprintf(thread_name, sizeof(thread_name),\n-\t\t\t\"rte-worker-%d\", i);\n-\t\trte_thread_set_name(lcore_config[i].thread_id, thread_name);\n+\t\t\tif (pipe(lcore_config[i].pipe_main2worker) < 0)\n+\t\t\t\trte_panic(\"Cannot create pipe\\n\");\n+\t\t\tif (pipe(lcore_config[i].pipe_worker2main) < 0)\n+\t\t\t\trte_panic(\"Cannot create pipe\\n\");\n+\n+\t\t\tlcore_config[i].state = WAIT;\n+\n+\t\t\t/* create a thread for each lcore */\n+\t\t\tret = eal_worker_thread_create(i);\n+\t\t\tif (ret != 0)\n+\t\t\t\trte_panic(\"Cannot create thread\\n\");\n+\n+\t\t\t/* Set thread_name for aid in debugging. */\n+\t\t\tsnprintf(thread_name, sizeof(thread_name),\n+\t\t\t\t\"rte-worker-%d\", i);\n+\t\t\trte_thread_set_name(lcore_config[i].thread_id, thread_name);\n+\n+\t\t\tret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,\n+\t\t\t\t&lcore_config[i].cpuset);\n+\t\t\tif (ret != 0)\n+\t\t\t\trte_panic(\"Cannot set affinity\\n\");\n+\t\t}\n \n-\t\tret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id,\n-\t\t\t&lcore_config[i].cpuset);\n-\t\tif (ret != 0)\n-\t\t\trte_panic(\"Cannot set affinity\\n\");\n+\t\t/*\n+\t\t * Launch a dummy function on all worker lcores, so that main lcore\n+\t\t * knows they are all ready when this function returns.\n+\t\t */\n+\t\trte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);\n+\t\trte_eal_mp_wait_lcore();\n+\t\tworker_initialized = true;\n \t}\n \n-\t/*\n-\t * Launch a dummy function on all worker lcores, so that main lcore\n-\t * knows they are all ready when this function returns.\n-\t */\n-\trte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);\n-\trte_eal_mp_wait_lcore();\n-\n \t/* initialize services so vdevs register service during bus_probe. */\n \tret = rte_service_init();\n \tif (ret) {\n", "prefixes": [ "v4", "8/8" ] }{ "id": 130360, "url": "