Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/131205/?format=api
https://patches.dpdk.org/api/patches/131205/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230906162226.1618088-9-thomas@monjalon.net/", "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": "<20230906162226.1618088-9-thomas@monjalon.net>", "list_archive_url": "https://inbox.dpdk.org/dev/20230906162226.1618088-9-thomas@monjalon.net", "date": "2023-09-06T16:12:25", "name": "[08/11] examples: convert to normal control threads", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2ea5fd5aee380731cd49f1c8b43ad482c4e9795d", "submitter": { "id": 685, "url": "https://patches.dpdk.org/api/people/685/?format=api", "name": "Thomas Monjalon", "email": "thomas@monjalon.net" }, "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/20230906162226.1618088-9-thomas@monjalon.net/mbox/", "series": [ { "id": 29438, "url": "https://patches.dpdk.org/api/series/29438/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29438", "date": "2023-09-06T16:12:17", "name": "rework thread management", "version": 1, "mbox": "https://patches.dpdk.org/series/29438/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/131205/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/131205/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 78D5542529;\n\tWed, 6 Sep 2023 18:23:58 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A2801402DB;\n\tWed, 6 Sep 2023 18:23:54 +0200 (CEST)", "from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com\n [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 66052402D1\n for <dev@dpdk.org>; Wed, 6 Sep 2023 18:23:52 +0200 (CEST)", "from compute3.internal (compute3.nyi.internal [10.202.2.43])\n by mailout.west.internal (Postfix) with ESMTP id 17FA03200983;\n Wed, 6 Sep 2023 12:23:51 -0400 (EDT)", "from mailfrontend2 ([10.202.2.163])\n by compute3.internal (MEProxy); Wed, 06 Sep 2023 12:23:51 -0400", "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 6 Sep 2023 12:23:49 -0400 (EDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n cc:cc:content-transfer-encoding:content-type:date:date:from:from\n :in-reply-to:in-reply-to:message-id:mime-version:references\n :reply-to:sender:subject:subject:to:to; s=fm1; t=1694017430; x=\n 1694103830; bh=Bpq3EzfPk3YeaV5w/zADO/Q60SW+CgY7G6pAJOXm2U4=; b=I\n EjbmqmuZKBGsA6mu/UAMKe38TX3PV7w/3IBtoGAulZxVyVxsjmkkXkTq/mQtVDCz\n 2NAjDdf30ZVUP4Zi+rSAb4OhbWJWbnWr0DHPzwxUdzxptO6gKwMx0zXMe1EcFqba\n Xk8eFa0Lpmdg/NDms//WSkwMbDHxtNp2IkDds/5q/tTxAqRSycbK6a1ixS5agvWZ\n a7bBPJZQ8jfkpBXEZQ4Aa658xFFe9rQ9fo8PelsxqjQIUPT98sSVo3l1xawWxaEc\n RKM9jieCUKG91CzuoGKG0CTGx2f3pFIhkfrrG44W86SpLGJ60bKlHVDfdMs8QfsL\n bpDZTA6LPtV1vooOaPC+Q==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:cc:content-transfer-encoding\n :content-type:date:date:feedback-id:feedback-id:from:from\n :in-reply-to:in-reply-to:message-id:mime-version:references\n :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy\n :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1694017430; x=\n 1694103830; bh=Bpq3EzfPk3YeaV5w/zADO/Q60SW+CgY7G6pAJOXm2U4=; b=q\n 582XytPR9MVkNb6IShV8iOe55D+ayAdbEqI5FKs9NtomhGHzMZwhb9zsJs2mgIum\n xq12Tul00Mhtf9X/S8BEdtXeHxxxWUdjU9DSV3EG0MM3dgnw9vKgeG1S7pgtL+e7\n QeeU+x7EIpuU4thf0Bmj1ngDbmiK8ikBseOo1RQmOsQ9H85KPH1nfuSBeGKmWajc\n XtXvlyC+PjFY5CxqB9HrN2gHfa7UbuVSHQV6t8uLNuwkW92scRP3Xqg8qTkFQVEm\n 1LUGSy8YYFdeKU1OARvF0orudtlFlT2VB6uJYwRjsLjHnpXHLotWaiAhzBai2Sf2\n ZqtUGRLUzH4jarbYyZgMA==" ], "X-ME-Sender": "<xms:lqf4ZLZfoUYkAPIY8H9fUI0cE55sk98HJBy9hJ5FTlHtiYKZhJ0z1A>\n <xme:lqf4ZKZgcWZHCdUvVrX5j_nCSK4y-QwHa3sf3nxORi4LIWAU2clPaKIxzbbMabYhX\n V_szzpskFbf31VIhQ>", "X-ME-Received": "\n <xmr:lqf4ZN-ig3_9PJ-Wtkd9ymSK4_9sq0QtYfau1wl6A-DSyrHr0wDVQcSzmfW7r4aWqajIppiWNkWDpiIZRzf8E-IB9TSC4Q0>", "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedviedrudehfedguddttdcutefuodetggdotefrod\n ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh\n necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd\n enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhho\n mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne\n cuggftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfet\n veekhefhieelhfdtnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilh\n hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth", "X-ME-Proxy": "<xmx:lqf4ZBof2Fv_9WmYFNCL07i_ni5muia5OWg6fIA6SOf6-p5Eqcz8fw>\n <xmx:lqf4ZGpeMrtD54RBjUZ2-Q-Py3rATHyDZS6aZZs1DJNGM2AzXGLBoA>\n <xmx:lqf4ZHQL5GvSaOHH_eYqHUbntyBZzcDDmHX0YziQewU5aqImi0NGFQ>\n <xmx:lqf4ZPnLUZ3U2dcrcIFNjOVlibIv6RbaCPkAXd2Ak8xFBJsweqj-cw>", "Feedback-ID": "i47234305:Fastmail", "From": "Thomas Monjalon <thomas@monjalon.net>", "To": "dev@dpdk.org", "Cc": "Tyler Retzlaff <roretzla@linux.microsoft.com>,\n David Marchand <david.marchand@redhat.com>,\n Ferruh Yigit <ferruh.yigit@amd.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>", "Subject": "[PATCH 08/11] examples: convert to normal control threads", "Date": "Wed, 6 Sep 2023 18:12:25 +0200", "Message-ID": "<20230906162226.1618088-9-thomas@monjalon.net>", "X-Mailer": "git-send-email 2.42.0", "In-Reply-To": "<20230906162226.1618088-1-thomas@monjalon.net>", "References": "<20230906162226.1618088-1-thomas@monjalon.net>", "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": "Calls to rte_ctrl_thread_create() are replaced with\nrte_thread_create_control().\n\nIn vhost_blk, the control thread is not forced\nto be scheduled on core 0 anymore.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n examples/vhost/main.c | 9 +++++----\n examples/vhost_blk/vhost_blk.c | 21 ++++++---------------\n 2 files changed, 11 insertions(+), 19 deletions(-)", "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 9ff2c1f31b..ce5c1efddf 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -28,6 +28,7 @@\n #include <rte_pause.h>\n #include <rte_dmadev.h>\n #include <rte_vhost_async.h>\n+#include <rte_thread.h>\n \n #include \"main.h\"\n \n@@ -1807,7 +1808,7 @@ static const struct rte_vhost_device_ops virtio_net_device_ops =\n * This is a thread will wake up after a period to print stats if the user has\n * enabled them.\n */\n-static void *\n+static uint32_t\n print_stats(__rte_unused void *arg)\n {\n \tstruct vhost_dev *vdev;\n@@ -1852,7 +1853,7 @@ print_stats(__rte_unused void *arg)\n \t\tfflush(stdout);\n \t}\n \n-\treturn NULL;\n+\treturn 0;\n }\n \n static void\n@@ -1907,7 +1908,7 @@ main(int argc, char *argv[])\n \tunsigned nb_ports, valid_num_ports;\n \tint ret, i;\n \tuint16_t portid;\n-\tstatic pthread_t tid;\n+\trte_thread_t tid;\n \tuint64_t flags = RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;\n \n \tsignal(SIGINT, sigint_handler);\n@@ -1986,7 +1987,7 @@ main(int argc, char *argv[])\n \n \t/* Enable stats if the user option is set. */\n \tif (enable_stats) {\n-\t\tret = rte_ctrl_thread_create(&tid, \"dpdk-vhost-stat\", NULL,\n+\t\tret = rte_thread_create_control(&tid, \"dpdk-vhost-stat\",\n \t\t\t\t\tprint_stats, NULL);\n \t\tif (ret < 0)\n \t\t\trte_exit(EXIT_FAILURE,\ndiff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c\nindex 45699eb0b3..376f7b89a7 100644\n--- a/examples/vhost_blk/vhost_blk.c\n+++ b/examples/vhost_blk/vhost_blk.c\n@@ -5,8 +5,6 @@\n #ifndef _GNU_SOURCE\n #define _GNU_SOURCE\n #endif\n-#include <pthread.h>\n-#include <sched.h>\n \n #include <stdint.h>\n #include <stdlib.h>\n@@ -529,12 +527,10 @@ process_vq(struct vhost_blk_queue *vq)\n \t}\n }\n \n-static void *\n+static uint32_t\n ctrlr_worker(void *arg)\n {\n \tstruct vhost_blk_ctrlr *ctrlr = (struct vhost_blk_ctrlr *)arg;\n-\tcpu_set_t cpuset;\n-\tpthread_t thread;\n \tint i;\n \n \tfprintf(stdout, \"Ctrlr Worker Thread start\\n\");\n@@ -546,11 +542,6 @@ ctrlr_worker(void *arg)\n \t\texit(0);\n \t}\n \n-\tthread = pthread_self();\n-\tCPU_ZERO(&cpuset);\n-\tCPU_SET(0, &cpuset);\n-\tpthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);\n-\n \tfor (i = 0; i < NUM_OF_BLK_QUEUES; i++)\n \t\tsubmit_inflight_vq(&ctrlr->queues[i]);\n \n@@ -560,7 +551,7 @@ ctrlr_worker(void *arg)\n \n \tfprintf(stdout, \"Ctrlr Worker Thread Exiting\\n\");\n \tsem_post(&exit_sem);\n-\treturn NULL;\n+\treturn 0;\n }\n \n static int\n@@ -605,7 +596,7 @@ new_device(int vid)\n \tstruct vhost_blk_queue *vq;\n \tchar path[PATH_MAX];\n \tuint64_t features, protocol_features;\n-\tpthread_t tid;\n+\trte_thread_t tid;\n \tint i, ret;\n \tbool packed_ring, inflight_shmfd;\n \n@@ -686,15 +677,15 @@ new_device(int vid)\n \t/* start polling vring */\n \tworker_thread_status = WORKER_STATE_START;\n \tfprintf(stdout, \"New Device %s, Device ID %d\\n\", path, vid);\n-\tif (rte_ctrl_thread_create(&tid, \"dpdk-vhost-blk\", NULL,\n-\t\t\t\t &ctrlr_worker, ctrlr) != 0) {\n+\tif (rte_thread_create_control(&tid, \"dpdk-vhost-blk\",\n+\t\t\t&ctrlr_worker, ctrlr) != 0) {\n \t\tfprintf(stderr, \"Worker Thread Started Failed\\n\");\n \t\treturn -1;\n \t}\n \n \t/* device has been started */\n \tctrlr->started = 1;\n-\tpthread_detach(tid);\n+\trte_thread_detach(tid);\n \treturn 0;\n }\n \n", "prefixes": [ "08/11" ] }{ "id": 131205, "url": "