get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/131392/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 131392,
    "url": "http://patches.dpdk.org/api/patches/131392/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230913114351.1940459-7-thomas@monjalon.net/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230913114351.1940459-7-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230913114351.1940459-7-thomas@monjalon.net",
    "date": "2023-09-13T11:28:19",
    "name": "[v3,06/11] lib: convert to internal control threads",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "97eafb1940825047bba8792e4c9dc985fc7f114d",
    "submitter": {
        "id": 685,
        "url": "http://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230913114351.1940459-7-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 29494,
            "url": "http://patches.dpdk.org/api/series/29494/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29494",
            "date": "2023-09-13T11:28:13",
            "name": "rework thread management",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/29494/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/131392/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/131392/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 E504542588;\n\tWed, 13 Sep 2023 13:45:41 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D393340A7F;\n\tWed, 13 Sep 2023 13:45:39 +0200 (CEST)",
            "from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com\n [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 70D9940A7F\n for <dev@dpdk.org>; Wed, 13 Sep 2023 13:45:37 +0200 (CEST)",
            "from compute4.internal (compute4.nyi.internal [10.202.2.44])\n by mailout.west.internal (Postfix) with ESMTP id 3625D32002E8;\n Wed, 13 Sep 2023 07:45:35 -0400 (EDT)",
            "from mailfrontend1 ([10.202.2.162])\n by compute4.internal (MEProxy); Wed, 13 Sep 2023 07:45:36 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 13 Sep 2023 07:45:32 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n cc:cc:content-transfer-encoding:content-type:content-type:date\n :date:from:from:in-reply-to:in-reply-to:message-id:mime-version\n :references:reply-to:sender:subject:subject:to:to; s=fm2; t=\n 1694605534; x=1694691934; bh=ecpQRRc/6W/1/MdPdGqxXxKE5PvQ6KULBf6\n JwkOr8Rg=; b=bPh8A7pXFOCz3LX14v6kpgUQk5KFiRcX+6R5v5FDY6UAbPp2d9x\n vQHiJrfETuiHvLOkymL/xQLY3XKItyb6aNZpsdZkl34JjDbiiYiJ4tALPrAOMIVN\n 6nRHz+yKV/3Xy1q5lCNV9t68WUPTsNeHy2DrjYsk693qLT4i7cILP49alp/zdANy\n bLIkNlRecOmmNVyjChVt+pgovgGiD8AlScMHNgAcscb83zBMC/W0tRB+iJlo74BG\n 4SFk1dXx6Pj177IXpSO4Wa0Zl6+KPm1chnGUj6WptYHFN7pSkQ52YcUhlmslUrvI\n o/Nw/k6zjFukkLEzOAx9Ei5YBgn6kRhJhFg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:cc:content-transfer-encoding\n :content-type:content-type:date:date:feedback-id:feedback-id\n :from:from:in-reply-to:in-reply-to:message-id:mime-version\n :references:reply-to:sender:subject:subject:to:to:x-me-proxy\n :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=\n 1694605534; x=1694691934; bh=ecpQRRc/6W/1/MdPdGqxXxKE5PvQ6KULBf6\n JwkOr8Rg=; b=o+6t0vkjeuGcBJk8myt57TiAnortf6Out1OzZEC8/0OLe0kad5x\n u/DYETHYzIHnXRYBs0PetuNK6mv0+ap4l5C6pkoODjWJpYuw+pctE2n8p4i+u3uu\n TNnWp8N5AZcn4srNJWhfE10Pko9SotMmvuTRkFJnsdVF+8G53U0mu4MHvNrQx8NM\n MgzUWj83w+Q7WMto21b81X2CGnVQctu5P9haQdmBw3DcWecn+uMS/InHX5tXU7Of\n rc2S62dnruy1bf9m94bZ7uCA3+9ghdKz1UIlrcy3tXBHHM1RFviFTOc1OkgWr6UY\n MFHvJMdpNAzyafdrEt8MMi3LhJB85yfZEqw=="
        ],
        "X-ME-Sender": "<xms:3qABZSpFEaDL98d10Nqyq6WIkOa9uKZcY8nCnT_oRgbHodrzJD7KEg>\n <xme:3qABZQpLLCILsjqolhQLw353HpUNwPGVXsE3JIrytU606VoW_MMNCynk9eRQyBbX4\n MPIwWTf0poDqWwhcg>",
        "X-ME-Received": "\n <xmr:3qABZXNH3yhe6tDLWXd3G8O_L7EjmBVkbpflElmeopWPAN9UNxKTp2lv_BmWUBaMNJ6CiQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedviedrudeikedggeegucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhho\n mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne\n cuggftrfgrthhtvghrnheptdeiffffgeefteelhfekueetueduffejgfelvedtieejudek\n gfevheetheehgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh\n hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth",
        "X-ME-Proxy": "<xmx:3qABZR4qKt4etrU3jvOVIOK3tjRZucCpMzw7mkoH0MFurQIPJXhI7A>\n <xmx:3qABZR6nto04w2Ghg7JgiWOOv1ZzpPfa-Mcpk884yKtklPcJBRUm0g>\n <xmx:3qABZRi4eAX4zyaak9K9YaKS-0XrSl4wxh76cit5l-m1odxeSV22uw>\n <xmx:3qABZQRD320USrDYq25aJG9yht6OwM7v0r6BYGgvDKes-WOm9OBDtg>",
        "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 =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Harman Kalra <hkalra@marvell.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>,\n Naga Harish K S V <s.v.naga.harish.k@intel.com>,\n Jerin Jacob <jerinj@marvell.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>",
        "Subject": "[PATCH v3 06/11] lib: convert to internal control threads",
        "Date": "Wed, 13 Sep 2023 13:28:19 +0200",
        "Message-ID": "<20230913114351.1940459-7-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20230913114351.1940459-1-thomas@monjalon.net>",
        "References": "<20230906162226.1618088-1-thomas@monjalon.net>\n <20230913114351.1940459-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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_internal_control().\nOther pthread-related functions are replaced with the rte_thread API.\nOnly pthread_cancel() has no replacement.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/eal/common/eal_common_proc.c        | 15 ++++++++-------\n lib/eal/freebsd/eal_interrupts.c        | 10 +++++-----\n lib/eal/linux/eal_interrupts.c          | 10 +++++-----\n lib/eal/linux/eal_timer.c               | 11 ++++++-----\n lib/eal/unix/rte_thread.c               |  2 +-\n lib/eal/windows/eal_interrupts.c        |  2 +-\n lib/eventdev/rte_event_eth_rx_adapter.c | 23 ++++++++++++-----------\n lib/vhost/fd_man.c                      |  6 +++---\n lib/vhost/fd_man.h                      |  2 +-\n lib/vhost/socket.c                      | 23 +++++++++++------------\n lib/vhost/vduse.c                       |  5 +++--\n 11 files changed, 56 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c\nindex 26e6b78f8f..f20a348ede 100644\n--- a/lib/eal/common/eal_common_proc.c\n+++ b/lib/eal/common/eal_common_proc.c\n@@ -26,6 +26,7 @@\n #include <rte_errno.h>\n #include <rte_lcore.h>\n #include <rte_log.h>\n+#include <rte_thread.h>\n \n #include \"eal_memcfg.h\"\n #include \"eal_private.h\"\n@@ -33,7 +34,7 @@\n #include \"eal_internal_cfg.h\"\n \n static int mp_fd = -1;\n-static pthread_t mp_handle_tid;\n+static rte_thread_t mp_handle_tid;\n static char mp_filter[PATH_MAX];   /* Filter for secondary process sockets */\n static char mp_dir_path[PATH_MAX]; /* The directory path for all mp sockets */\n static pthread_mutex_t mp_mutex_action = PTHREAD_MUTEX_INITIALIZER;\n@@ -396,7 +397,7 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s)\n \t}\n }\n \n-static void *\n+static uint32_t\n mp_handle(void *arg __rte_unused)\n {\n \tstruct mp_msg_internal msg;\n@@ -413,7 +414,7 @@ mp_handle(void *arg __rte_unused)\n \t\tprocess_msg(&msg, &sa);\n \t}\n \n-\treturn NULL;\n+\treturn 0;\n }\n \n static int\n@@ -646,8 +647,8 @@ rte_mp_channel_init(void)\n \t\treturn -1;\n \t}\n \n-\tif (rte_ctrl_thread_create(&mp_handle_tid, \"dpdk-mp-msg\",\n-\t\t\tNULL, mp_handle, NULL) < 0) {\n+\tif (rte_thread_create_internal_control(&mp_handle_tid, \"mp-msg\",\n+\t\t\tmp_handle, NULL) < 0) {\n \t\tRTE_LOG(ERR, EAL, \"failed to create mp thread: %s\\n\",\n \t\t\tstrerror(errno));\n \t\tclose(dir_fd);\n@@ -671,8 +672,8 @@ rte_mp_channel_cleanup(void)\n \tif (fd < 0)\n \t\treturn;\n \n-\tpthread_cancel(mp_handle_tid);\n-\tpthread_join(mp_handle_tid, NULL);\n+\tpthread_cancel((pthread_t)mp_handle_tid.opaque_id);\n+\trte_thread_join(mp_handle_tid, NULL);\n \tclose_socket_fd(fd);\n }\n \ndiff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c\nindex 68cdb9deb3..2b31dfb099 100644\n--- a/lib/eal/freebsd/eal_interrupts.c\n+++ b/lib/eal/freebsd/eal_interrupts.c\n@@ -52,7 +52,7 @@ static rte_spinlock_t intr_lock = RTE_SPINLOCK_INITIALIZER;\n static struct rte_intr_source_list intr_sources;\n \n /* interrupt handling thread */\n-static pthread_t intr_thread;\n+static rte_thread_t intr_thread;\n \n static volatile int kq = -1;\n \n@@ -591,7 +591,7 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)\n \t}\n }\n \n-static void *\n+static uint32_t\n eal_intr_thread_main(void *arg __rte_unused)\n {\n \tstruct kevent events[MAX_INTR_EVENTS];\n@@ -619,7 +619,7 @@ eal_intr_thread_main(void *arg __rte_unused)\n \t}\n \tclose(kq);\n \tkq = -1;\n-\treturn NULL;\n+\treturn 0;\n }\n \n int\n@@ -637,7 +637,7 @@ rte_eal_intr_init(void)\n \t}\n \n \t/* create the host thread to wait/handle the interrupt */\n-\tret = rte_ctrl_thread_create(&intr_thread, \"dpdk-intr\", NULL,\n+\tret = rte_thread_create_internal_control(&intr_thread, \"intr\",\n \t\t\teal_intr_thread_main, NULL);\n \tif (ret != 0) {\n \t\trte_errno = -ret;\n@@ -746,5 +746,5 @@ rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle)\n \n int rte_thread_is_intr(void)\n {\n-\treturn pthread_equal(intr_thread, pthread_self());\n+\treturn rte_thread_equal(intr_thread, rte_thread_self());\n }\ndiff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c\nindex 19b36787b8..24fff3d3c2 100644\n--- a/lib/eal/linux/eal_interrupts.c\n+++ b/lib/eal/linux/eal_interrupts.c\n@@ -5,7 +5,6 @@\n #include <stdio.h>\n #include <stdint.h>\n #include <stdlib.h>\n-#include <pthread.h>\n #include <sys/queue.h>\n #include <unistd.h>\n #include <string.h>\n@@ -19,6 +18,7 @@\n #include <eal_trace_internal.h>\n #include <rte_common.h>\n #include <rte_interrupts.h>\n+#include <rte_thread.h>\n #include <rte_per_lcore.h>\n #include <rte_lcore.h>\n #include <rte_branch_prediction.h>\n@@ -89,7 +89,7 @@ static union intr_pipefds intr_pipe;\n static struct rte_intr_source_list intr_sources;\n \n /* interrupt handling thread */\n-static pthread_t intr_thread;\n+static rte_thread_t intr_thread;\n \n /* VFIO interrupts */\n #ifdef VFIO_PRESENT\n@@ -1103,7 +1103,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)\n  * @return\n  *  never return;\n  */\n-static __rte_noreturn void *\n+static __rte_noreturn uint32_t\n eal_intr_thread_main(__rte_unused void *arg)\n {\n \t/* host thread, never break out */\n@@ -1188,7 +1188,7 @@ rte_eal_intr_init(void)\n \t}\n \n \t/* create the host thread to wait/handle the interrupt */\n-\tret = rte_ctrl_thread_create(&intr_thread, \"dpdk-intr\", NULL,\n+\tret = rte_thread_create_internal_control(&intr_thread, \"intr\",\n \t\t\teal_intr_thread_main, NULL);\n \tif (ret != 0) {\n \t\trte_errno = -ret;\n@@ -1601,5 +1601,5 @@ rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)\n \n int rte_thread_is_intr(void)\n {\n-\treturn pthread_equal(intr_thread, pthread_self());\n+\treturn rte_thread_equal(intr_thread, rte_thread_self());\n }\ndiff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c\nindex 1898709700..3a30284e3a 100644\n--- a/lib/eal/linux/eal_timer.c\n+++ b/lib/eal/linux/eal_timer.c\n@@ -14,6 +14,7 @@\n \n #include <rte_common.h>\n #include <rte_cycles.h>\n+#include <rte_thread.h>\n \n #include \"eal_private.h\"\n \n@@ -71,14 +72,14 @@ static uint64_t eal_hpet_resolution_hz = 0;\n /* Incremented 4 times during one 32bits hpet full count */\n static uint32_t eal_hpet_msb;\n \n-static pthread_t msb_inc_thread_id;\n+static rte_thread_t msb_inc_thread_id;\n \n /*\n  * This function runs on a specific thread to update a global variable\n  * containing used to process MSB of the HPET (unfortunately, we need\n  * this because hpet is 32 bits by default under linux).\n  */\n-static void *\n+static uint32_t\n hpet_msb_inc(__rte_unused void *arg)\n {\n \tuint32_t t;\n@@ -89,7 +90,7 @@ hpet_msb_inc(__rte_unused void *arg)\n \t\t\teal_hpet_msb ++;\n \t\tsleep(10);\n \t}\n-\treturn NULL;\n+\treturn 0;\n }\n \n uint64_t\n@@ -176,8 +177,8 @@ rte_eal_hpet_init(int make_default)\n \n \t/* create a thread that will increment a global variable for\n \t * msb (hpet is 32 bits by default under linux) */\n-\tret = rte_ctrl_thread_create(&msb_inc_thread_id, \"dpdk-hpet-msb\", NULL,\n-\t\t\t\t     hpet_msb_inc, NULL);\n+\tret = rte_thread_create_internal_control(&msb_inc_thread_id, \"hpet-msb\",\n+\t\t\thpet_msb_inc, NULL);\n \tif (ret != 0) {\n \t\tRTE_LOG(ERR, EAL, \"ERROR: Cannot create HPET timer thread!\\n\");\n \t\tinternal_conf->no_hpet = 1;\ndiff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c\nindex f4076122a4..36a21ab2f9 100644\n--- a/lib/eal/unix/rte_thread.c\n+++ b/lib/eal/unix/rte_thread.c\n@@ -190,7 +190,7 @@ rte_thread_create(rte_thread_t *thread_id,\n \tpthread_mutex_unlock(&ctx.wrapper_mutex);\n \n \tif (ret != 0)\n-\t\tpthread_join((pthread_t)thread_id->opaque_id, NULL);\n+\t\trte_thread_join(*thread_id, NULL);\n \n cleanup:\n \tif (attrp != NULL)\ndiff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c\nindex 66a49c844a..49efdc098c 100644\n--- a/lib/eal/windows/eal_interrupts.c\n+++ b/lib/eal/windows/eal_interrupts.c\n@@ -98,7 +98,7 @@ rte_eal_intr_init(void)\n \t\treturn -1;\n \t}\n \n-\tret = rte_thread_create_control(&intr_thread, \"dpdk-intr\",\n+\tret = rte_thread_create_internal_control(&intr_thread, \"intr\",\n \t\t\teal_intr_thread_main, NULL);\n \tif (ret != 0) {\n \t\trte_errno = -ret;\ndiff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c\nindex 3ebfa5366d..c166ef69a8 100644\n--- a/lib/eventdev/rte_event_eth_rx_adapter.c\n+++ b/lib/eventdev/rte_event_eth_rx_adapter.c\n@@ -10,6 +10,7 @@\n #include <unistd.h>\n \n #include <rte_cycles.h>\n+#include <rte_thread.h>\n #include <rte_common.h>\n #include <dev_driver.h>\n #include <rte_errno.h>\n@@ -165,7 +166,7 @@ struct event_eth_rx_adapter {\n \t/* Count of interrupt vectors in use */\n \tuint32_t num_intr_vec;\n \t/* Thread blocked on Rx interrupts */\n-\tpthread_t rx_intr_thread;\n+\trte_thread_t rx_intr_thread;\n \t/* Configuration callback for rte_service configuration */\n \trte_event_eth_rx_adapter_conf_cb conf_cb;\n \t/* Configuration callback argument */\n@@ -1154,13 +1155,13 @@ rxa_intr_ring_del_entries(struct event_eth_rx_adapter *rx_adapter,\n \trte_spinlock_unlock(&rx_adapter->intr_ring_lock);\n }\n \n-/* pthread callback handling interrupt mode receive queues\n+/* thread callback handling interrupt mode receive queues\n  * After receiving an Rx interrupt, it enqueues the port id and queue id of the\n  * interrupting queue to the adapter's ring buffer for interrupt events.\n  * These events are picked up by rxa_intr_ring_dequeue() which is invoked from\n  * the adapter service function.\n  */\n-static void *\n+static uint32_t\n rxa_intr_thread(void *arg)\n {\n \tstruct event_eth_rx_adapter *rx_adapter = arg;\n@@ -1179,7 +1180,7 @@ rxa_intr_thread(void *arg)\n \t\t}\n \t}\n \n-\treturn NULL;\n+\treturn 0;\n }\n \n /* Dequeue <port, q> from interrupt ring and enqueue received\n@@ -1595,7 +1596,7 @@ static int\n rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter)\n {\n \tint err;\n-\tchar thread_name[RTE_MAX_THREAD_NAME_LEN];\n+\tchar thread_name[RTE_THREAD_INTERNAL_NAME_SIZE];\n \n \tif (rx_adapter->intr_ring)\n \t\treturn 0;\n@@ -1618,11 +1619,11 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter)\n \n \trte_spinlock_init(&rx_adapter->intr_ring_lock);\n \n-\tsnprintf(thread_name, RTE_MAX_THREAD_NAME_LEN,\n-\t\t\t\"dpdk-evt-rx%d\", rx_adapter->id);\n+\tsnprintf(thread_name, sizeof(thread_name),\n+\t\t\t\"evt-rx%d\", rx_adapter->id);\n \n-\terr = rte_ctrl_thread_create(&rx_adapter->rx_intr_thread, thread_name,\n-\t\t\t\tNULL, rxa_intr_thread, rx_adapter);\n+\terr = rte_thread_create_internal_control(&rx_adapter->rx_intr_thread,\n+\t\t\tthread_name, rxa_intr_thread, rx_adapter);\n \tif (!err)\n \t\treturn 0;\n \n@@ -1640,12 +1641,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter)\n {\n \tint err;\n \n-\terr = pthread_cancel(rx_adapter->rx_intr_thread);\n+\terr = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id);\n \tif (err)\n \t\tRTE_EDEV_LOG_ERR(\"Can't cancel interrupt thread err = %d\\n\",\n \t\t\t\terr);\n \n-\terr = pthread_join(rx_adapter->rx_intr_thread, NULL);\n+\terr = rte_thread_join(rx_adapter->rx_intr_thread, NULL);\n \tif (err)\n \t\tRTE_EDEV_LOG_ERR(\"Can't join interrupt thread err = %d\\n\", err);\n \ndiff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c\nindex 1876fada33..134414fb4b 100644\n--- a/lib/vhost/fd_man.c\n+++ b/lib/vhost/fd_man.c\n@@ -212,7 +212,7 @@ fdset_try_del(struct fdset *pfdset, int fd)\n  * will wait until the flag is reset to zero(which indicates the callback is\n  * finished), then it could free the context after fdset_del.\n  */\n-void *\n+uint32_t\n fdset_event_dispatch(void *arg)\n {\n \tint i;\n@@ -227,7 +227,7 @@ fdset_event_dispatch(void *arg)\n \tint val;\n \n \tif (pfdset == NULL)\n-\t\treturn NULL;\n+\t\treturn 0;\n \n \twhile (1) {\n \n@@ -303,7 +303,7 @@ fdset_event_dispatch(void *arg)\n \t\t\tfdset_shrink(pfdset);\n \t}\n \n-\treturn NULL;\n+\treturn 0;\n }\n \n static void\ndiff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h\nindex 6f4499bdfa..6315904c8e 100644\n--- a/lib/vhost/fd_man.h\n+++ b/lib/vhost/fd_man.h\n@@ -46,7 +46,7 @@ int fdset_add(struct fdset *pfdset, int fd,\n void *fdset_del(struct fdset *pfdset, int fd);\n int fdset_try_del(struct fdset *pfdset, int fd);\n \n-void *fdset_event_dispatch(void *arg);\n+uint32_t fdset_event_dispatch(void *arg);\n \n int fdset_pipe_init(struct fdset *fdset);\n \ndiff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\nindex 12095b0e1a..5882e44176 100644\n--- a/lib/vhost/socket.c\n+++ b/lib/vhost/socket.c\n@@ -13,8 +13,8 @@\n #include <sys/queue.h>\n #include <errno.h>\n #include <fcntl.h>\n-#include <pthread.h>\n \n+#include <rte_thread.h>\n #include <rte_log.h>\n \n #include \"fd_man.h\"\n@@ -431,7 +431,7 @@ struct vhost_user_reconnect_list {\n };\n \n static struct vhost_user_reconnect_list reconn_list;\n-static pthread_t reconn_tid;\n+static rte_thread_t reconn_tid;\n \n static int\n vhost_user_connect_nonblock(char *path, int fd, struct sockaddr *un, size_t sz)\n@@ -455,7 +455,7 @@ vhost_user_connect_nonblock(char *path, int fd, struct sockaddr *un, size_t sz)\n \treturn 0;\n }\n \n-static void *\n+static uint32_t\n vhost_user_client_reconnect(void *arg __rte_unused)\n {\n \tint ret;\n@@ -496,7 +496,7 @@ vhost_user_client_reconnect(void *arg __rte_unused)\n \t\tsleep(1);\n \t}\n \n-\treturn NULL;\n+\treturn 0;\n }\n \n static int\n@@ -511,8 +511,8 @@ vhost_user_reconnect_init(void)\n \t}\n \tTAILQ_INIT(&reconn_list.head);\n \n-\tret = rte_ctrl_thread_create(&reconn_tid, \"dpdk-vhost-reco\", NULL,\n-\t\t\t     vhost_user_client_reconnect, NULL);\n+\tret = rte_thread_create_internal_control(&reconn_tid, \"vhost-reco\",\n+\t\t\tvhost_user_client_reconnect, NULL);\n \tif (ret != 0) {\n \t\tVHOST_LOG_CONFIG(\"thread\", ERR, \"failed to create reconnect thread\\n\");\n \t\tif (pthread_mutex_destroy(&reconn_list.mutex))\n@@ -1004,7 +1004,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tif (!vsocket->is_vduse) {\n \t\tif ((flags & RTE_VHOST_USER_CLIENT) != 0) {\n \t\t\tvsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);\n-\t\t\tif (vsocket->reconnect && reconn_tid == 0) {\n+\t\t\tif (vsocket->reconnect && reconn_tid.opaque_id == 0) {\n \t\t\t\tif (vhost_user_reconnect_init() != 0)\n \t\t\t\t\tgoto out_mutex;\n \t\t\t}\n@@ -1174,7 +1174,7 @@ int\n rte_vhost_driver_start(const char *path)\n {\n \tstruct vhost_user_socket *vsocket;\n-\tstatic pthread_t fdset_tid;\n+\tstatic rte_thread_t fdset_tid;\n \n \tpthread_mutex_lock(&vhost_user.mutex);\n \tvsocket = find_vhost_user_socket(path);\n@@ -1186,7 +1186,7 @@ rte_vhost_driver_start(const char *path)\n \tif (vsocket->is_vduse)\n \t\treturn vduse_device_create(path, vsocket->net_compliant_ol_flags);\n \n-\tif (fdset_tid == 0) {\n+\tif (fdset_tid.opaque_id == 0) {\n \t\t/**\n \t\t * create a pipe which will be waited by poll and notified to\n \t\t * rebuild the wait list of poll.\n@@ -1196,9 +1196,8 @@ rte_vhost_driver_start(const char *path)\n \t\t\treturn -1;\n \t\t}\n \n-\t\tint ret = rte_ctrl_thread_create(&fdset_tid,\n-\t\t\t\"dpdk-vhost-evt\", NULL, fdset_event_dispatch,\n-\t\t\t&vhost_user.fdset);\n+\t\tint ret = rte_thread_create_internal_control(&fdset_tid,\n+\t\t\t\t\"vhost-evt\", fdset_event_dispatch, &vhost_user.fdset);\n \t\tif (ret != 0) {\n \t\t\tVHOST_LOG_CONFIG(path, ERR, \"failed to create fdset handling thread\\n\");\n \t\t\tfdset_pipe_uninit(&vhost_user.fdset);\ndiff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c\nindex 7770259f37..e342f53b81 100644\n--- a/lib/vhost/vduse.c\n+++ b/lib/vhost/vduse.c\n@@ -16,6 +16,7 @@\n #include <sys/stat.h>\n \n #include <rte_common.h>\n+#include <rte_thread.h>\n \n #include \"fd_man.h\"\n #include \"iotlb.h\"\n@@ -415,7 +416,7 @@ int\n vduse_device_create(const char *path, bool compliant_ol_flags)\n {\n \tint control_fd, dev_fd, vid, ret;\n-\tpthread_t fdset_tid;\n+\trte_thread_t fdset_tid;\n \tuint32_t i, max_queue_pairs, total_queues;\n \tstruct virtio_net *dev;\n \tstruct virtio_net_config vnet_config = {{ 0 }};\n@@ -435,7 +436,7 @@ vduse_device_create(const char *path, bool compliant_ol_flags)\n \t\t\treturn -1;\n \t\t}\n \n-\t\tret = rte_ctrl_thread_create(&fdset_tid, \"dpdk-vduse-evt\", NULL,\n+\t\tret = rte_thread_create_internal_control(&fdset_tid, \"vduse-evt\",\n \t\t\t\tfdset_event_dispatch, &vduse.fdset);\n \t\tif (ret != 0) {\n \t\t\tVHOST_LOG_CONFIG(path, ERR, \"failed to create vduse fdset handling thread\\n\");\n",
    "prefixes": [
        "v3",
        "06/11"
    ]
}