Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/111628/?format=api
https://patches.dpdk.org/api/patches/111628/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1653311234-329-3-git-send-email-roretzla@linux.microsoft.com/", "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": "<1653311234-329-3-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1653311234-329-3-git-send-email-roretzla@linux.microsoft.com", "date": "2022-05-23T13:07:14", "name": "[v2,2/2] test/threads: add unit test for get set priority", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "656bf9b81f8970669f7c253f1c111c1f3c28f8ea", "submitter": { "id": 2077, "url": "https://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1653311234-329-3-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 23095, "url": "https://patches.dpdk.org/api/series/23095/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=23095", "date": "2022-05-23T13:07:13", "name": "add thread priority accessors", "version": 2, "mbox": "https://patches.dpdk.org/series/23095/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/111628/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/111628/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 78634A00C2;\n\tMon, 23 May 2022 15:07:27 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 44E6342685;\n\tMon, 23 May 2022 15:07:19 +0200 (CEST)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id B1BFE40156\n for <dev@dpdk.org>; Mon, 23 May 2022 15:07:16 +0200 (CEST)", "by linux.microsoft.com (Postfix, from userid 1086)\n id AE30720B87F3; Mon, 23 May 2022 06:07:15 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com AE30720B87F3", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1653311235;\n bh=XFawlqs0bP4s6Fgz4FWh6CiErLcUMjquf2KmwtF1DoE=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=GFzbOEUkqDprvXUHiSVr7MYLt+gZYQx2HtkdMJkMlbLtZQhMNTBdyvrAsvs75CUCp\n 6fav4upliXVJYzhztVevOz6O1CK3kV9QvSTJHpCeNL71eRzuF7YwGjtKw3emIhsxoH\n YWJUbT1LUIk2BY1KszYSXyYEbyRNJ9mKRzcInOgU=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, dmitry.kozliuk@gmail.com, anatoly.burakov@intel.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH v2 2/2] test/threads: add unit test for get set priority", "Date": "Mon, 23 May 2022 06:07:14 -0700", "Message-Id": "<1653311234-329-3-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1653311234-329-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1653302773-11043-1-git-send-email-roretzla@linux.microsoft.com>\n <1653311234-329-1-git-send-email-roretzla@linux.microsoft.com>", "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": "Add unit tests to exercise and demonstrate rte_thread_{get,set}_priority().\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n app/test/test_threads.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 52 insertions(+)", "diff": "diff --git a/app/test/test_threads.c b/app/test/test_threads.c\nindex e1a2ea5..dbc20e6 100644\n--- a/app/test/test_threads.c\n+++ b/app/test/test_threads.c\n@@ -24,6 +24,56 @@\n }\n \n static int\n+test_thread_priority(void)\n+{\n+\tpthread_t id;\n+\trte_thread_t thread_id;\n+\tenum rte_thread_priority priority;\n+\n+\tthread_id_ready = 0;\n+\tRTE_TEST_ASSERT(pthread_create(&id, NULL, thread_main, &thread_id) == 0,\n+\t\t\"Failed to create thread\");\n+\n+\twhile (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)\n+\t\t;\n+\n+\tpriority = RTE_THREAD_PRIORITY_NORMAL;\n+\tRTE_TEST_ASSERT(rte_thread_set_priority(thread_id, priority) == 0,\n+\t\t\"Failed to set thread priority\");\n+\tRTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,\n+\t\t\"Failed to get thread priority\");\n+\tRTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_NORMAL,\n+\t\t\"Priority set mismatches priority get\");\n+\n+\tpriority = RTE_THREAD_PRIORITY_REALTIME_CRITICAL;\n+#ifndef RTE_EXEC_ENV_WINDOWS\n+\tRTE_TEST_ASSERT(rte_thread_set_priority(thread_id, priority) == -ENOTSUP,\n+\t\t\"Priority set to critical should fail\");\n+\tRTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,\n+\t\t\"Failed to get thread priority\");\n+\tRTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_NORMAL,\n+\t\t\"Failed set to critical should have retained normal\");\n+#else\n+\tRTE_TEST_ASSERT(rte_thread_set_priority(thread_id, priority) == 0,\n+\t\t\"Priority set to critical should succeed\");\n+\tRTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,\n+\t\t\"Failed to get thread priority\");\n+\tRTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_REALTIME_CRITICAL,\n+\t\t\"Priority set mismatches priority get\");\n+#endif\n+\n+\tpriority = RTE_THREAD_PRIORITY_NORMAL;\n+\tRTE_TEST_ASSERT(rte_thread_set_priority(thread_id, priority) == 0,\n+\t\t\"Failed to set thread priority\");\n+\tRTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,\n+\t\t\"Failed to get thread priority\");\n+\tRTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_NORMAL,\n+\t\t\"Priority set mismatches priority get\");\n+\n+\treturn 0;\n+}\n+\n+static int\n test_thread_affinity(void)\n {\n \tpthread_t id;\n@@ -31,6 +81,7 @@\n \trte_cpuset_t cpuset0;\n \trte_cpuset_t cpuset1;\n \n+\tthread_id_ready = 0;\n \tRTE_TEST_ASSERT(pthread_create(&id, NULL, thread_main, &thread_id) == 0,\n \t\t\"Failed to create thread\");\n \n@@ -68,6 +119,7 @@\n \t.teardown = NULL,\n \t.unit_test_cases = {\n \t\tTEST_CASE(test_thread_affinity),\n+\t\tTEST_CASE(test_thread_priority),\n \t\tTEST_CASES_END()\n \t}\n };\n", "prefixes": [ "v2", "2/2" ] }{ "id": 111628, "url": "