Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/130456/?format=api
https://patches.dpdk.org/api/patches/130456/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230817042820.137957-9-okaya@kernel.org/", "project": { "id": 1, "url": "https://patches.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": "<20230817042820.137957-9-okaya@kernel.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230817042820.137957-9-okaya@kernel.org", "date": "2023-08-17T04:28:19", "name": "[v5,08/10] eal: initialize worker threads once", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "eadaed71f47d3512fe17e6f2557e23ee9d440541", "submitter": { "id": 2903, "url": "https://patches.dpdk.org/api/people/2903/?format=api", "name": "Sinan Kaya", "email": "okaya@kernel.org" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230817042820.137957-9-okaya@kernel.org/mbox/", "series": [ { "id": 29258, "url": "https://patches.dpdk.org/api/series/29258/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29258", "date": "2023-08-17T04:28:11", "name": "support reinit flow", "version": 5, "mbox": "https://patches.dpdk.org/series/29258/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/130456/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/130456/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 6D0164308A;\n\tThu, 17 Aug 2023 06:29:16 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D062C43273;\n\tThu, 17 Aug 2023 06:28:35 +0200 (CEST)", "from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])\n by mails.dpdk.org (Postfix) with ESMTP id 9AEB543260\n for <dev@dpdk.org>; Thu, 17 Aug 2023 06:28:29 +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 2A50162E32\n for <dev@dpdk.org>; Thu, 17 Aug 2023 04:28:29 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 45063C433C8;\n Thu, 17 Aug 2023 04:28:28 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1692246508;\n bh=GzdZY5BWZC5AIM3DNvKug6teVg99pRVvPOQuNBaih7w=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=ZGyO4JkhhVydO9gEtKXYMLr8lq+Y4VIkrL5UzFTK0wz6U/zuYhRjZrNbulEYzHe/W\n KuzITpAc4+sL9XFSC12fEPPAN3a0c0N8dK0lfWBEMCW9gujwLCX9lH0sMWdvHBJXct\n 5UT4oTwmDBSEwS2DQkF7MLGAz7r5bPWypU/zlfKo0U2bAAvjzvYpXeC2vgANqpteEU\n 3xSOu7lr2sdQH+qjSfjvCOryHI66vExFEHCzvHI8mHGftnLhNsov5r9wN+BGQv2Or8\n sIzEf+4kyAFauZ9FP7YPbaJAiyhoGQz5Crga8AJwOt9tbT73mZiEP3QLdUh31f8OEZ\n VJTwjeJqOWp3Q==", "From": "okaya@kernel.org", "To": "", "Cc": "dev@dpdk.org,\n\tSinan Kaya <okaya@kernel.org>", "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", "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": [ "v5", "08/10" ] }{ "id": 130456, "url": "