get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104137,
    "url": "http://patches.dpdk.org/api/patches/104137/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1636594425-9692-1-git-send-email-navasile@linux.microsoft.com/",
    "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": "<1636594425-9692-1-git-send-email-navasile@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1636594425-9692-1-git-send-email-navasile@linux.microsoft.com",
    "date": "2021-11-11T01:33:37",
    "name": "[v18,0/8] eal: Add EAL API for threading",
    "commit_ref": null,
    "pull_url": null,
    "state": null,
    "archived": false,
    "hash": null,
    "submitter": {
        "id": 1668,
        "url": "http://patches.dpdk.org/api/people/1668/?format=api",
        "name": "Narcisa Ana Maria Vasile",
        "email": "navasile@linux.microsoft.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1636594425-9692-1-git-send-email-navasile@linux.microsoft.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/104137/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/104137/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 CE7BAA0C4B;\n\tThu, 11 Nov 2021 02:34:58 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 655B6410F7;\n\tThu, 11 Nov 2021 02:34:55 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 4B9F340DF5\n for <dev@dpdk.org>; Thu, 11 Nov 2021 02:34:53 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1059)\n id 9068820C355B; Wed, 10 Nov 2021 17:34:52 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 9068820C355B",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1636594492;\n bh=902FgvY+BPAylWKaKY9xg/NOteJvYNaMzdVbP9RLU58=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=lN+iffohXmkMvxDsoG4rZrAsG6dhPnqvF1gtF6+IV0UfE6djOwCn5lpSjoUaz4Bo1\n 84kCT1fPhvDcEpqJv+vjDa8W/AsiQkZk4d/dGZ9nQMdXvxCOn1YHjM1hsFuoih51rJ\n ZpphVYVhOBiGDPf0rODtsU1Y23Jwud7zGsEmctrc=",
        "From": "Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>",
        "To": "dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com,\n khot@microsoft.com, navasile@microsoft.com, dmitrym@microsoft.com,\n roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com",
        "Cc": "bruce.richardson@intel.com, david.marchand@redhat.com,\n pallavi.kadam@intel.com",
        "Subject": "[PATCH v18 0/8]   eal: Add EAL API for threading",
        "Date": "Wed, 10 Nov 2021 17:33:37 -0800",
        "Message-Id": "<1636594425-9692-1-git-send-email-navasile@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1636513302-7359-1-git-send-email-navasile@linux.microsoft.com>",
        "References": "<1636513302-7359-1-git-send-email-navasile@linux.microsoft.com>",
        "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": "From: Narcisa Vasile <navasile@microsoft.com>\n\nEAL thread API\n\n**Problem Statement**\nDPDK currently uses the pthread interface to create and manage threads.\nWindows does not support the POSIX thread programming model,\nso it currently\nrelies on a header file that hides the Windows calls under\npthread matched interfaces. Given that EAL should isolate the environment\nspecifics from the applications and libraries and mediate\nall the communication with the operating systems, a new EAL interface\nis needed for thread management.\n\n**Goals**\n* Introduce a generic EAL API for threading support that will remove\n  the current Windows pthread.h shim.\n* Replace references to pthread_* across the DPDK codebase with the new\n  RTE_THREAD_* API.\n* Allow users to choose between using the RTE_THREAD_* API or a\n  3rd party thread library through a configuration option.\n\n**Design plan**\nNew API main files:\n* rte_thread.h (librte_eal/include)\n* rte_thread.c (librte_eal/windows)\n* rte_thread.c (librte_eal/common)\n\n**A schematic example of the design**\n--------------------------------------------------\nlib/librte_eal/include/rte_thread.h\nint rte_thread_create();\n\nlib/librte_eal/common/rte_thread.c\nint rte_thread_create() \n{\n\treturn pthread_create();\n}\n\nlib/librte_eal/windows/rte_thread.c\nint rte_thread_create() \n{\n\treturn CreateThread();\n}\n-----------------------------------------------------\n\n**Thread attributes**\n\nWhen or after a thread is created, specific characteristics of the thread\ncan be adjusted. Currently in DPDK most threads operate at the OS-default\npriority level but there are cases when increasing the priority is useful.\nFor example, high-performance applications require elevated priority to\navoid being preempted by other threads on the system.\nThe following structure that represents thread attributes has been\ndefined:\n\ntypedef struct\n{\n\tenum rte_thread_priority priority;\n\trte_cpuset_t cpuset;\n} rte_thread_attr_t;\n\nThe *rte_thread_create()* function can optionally receive\nan rte_thread_attr_t\nobject that will cause the thread to be created with the\naffinity and priority\ndescribed by the attributes object. If no rte_thread_attr_t is passed\n(parameter is NULL), the default affinity and priority are used.\nAn rte_thread_attr_t object can also be set to the default values\nby calling *rte_thread_attr_init()*.\n\n*Priority* is represented through an enum that currently advertises\ntwo values for priority:\n\t- RTE_THREAD_PRIORITY_NORMAL\n\t- RTE_THREAD_PRIORITY_REALTIME_CRITICAL\nThe enum can be extended to allow for multiple priority levels.\nrte_thread_set_priority      - sets the priority of a thread\nrte_thread_get_priority      - retrieves the priority of a thread\n                               from the OS\nrte_thread_attr_set_priority - updates an rte_thread_attr_t object\n                               with a new value for priority\n\n*Affinity* is described by the already known “rte_cpuset_t” type.\nrte_thread_attr_set/get_affinity - sets/gets the affinity field in a\n                                   rte_thread_attr_t object\nrte_thread_set/get_affinity      – sets/gets the affinity of a thread\n\n**Errors**\nAs different platforms have different error codes, the approach here\nis to translate the Windows error to POSIX-style ones to have\nuniformity over the values returned. \n\n**Future work**\nThe long term plan is for EAL to provide full threading support:\n* Add support for conditional variables\n* Additional functionality offered by pthread_*\n  (such as pthread_setname_np, etc.)\n\nv18:\n - Squash unit tests in corresponding patches.\n - Prevent priority to be set to realtime on non-Windows systems.\n - Use already existing affinity function in rte_thread_create()\n\nv17:\n - Move unrelated changes to the correct patch.\n - Rename RTE_STATIC_MUTEX to avoid confusion, since\n   the mutex is still dynamically initialized behind the scenes.\n - Break down the unit tests into smaller patches and reorder them.\n - Remove duplicated code in header\n - Improve commit messages and cover letter.\n\nv16:\n- Fix warning on freebsd by adding cast\n- Change affinity unit test to consider ases when the requested CPU\n  are not available on the system.\n- Fix priority unit test to avoid termination of thread before the\n  priority is checked.\n\nv15:\n- Add try_lock mutex functionality. If the mutex is already owned by a\n  different thread, the function returns immediately. Otherwise, \n  the mutex will be acquired.\n- Add function for getting the priority of a thread.\n  An auxiliary function that translates the OS priority to the\n  EAL accepted ones is added.\n- Fix unit tests logging, add descriptive asserts that mark test failures.\n  Verify mutex locking, verify barrier return values. Add test for\n  statically initialized mutexes.\n- Fix Alpine build by removing the use of pthread_attr_set_affinity() and\n  using pthread_set_affinity() after the thread is created.\n\nv14:\n- Remove patch \"eal: add EAL argument for setting thread priority\"\n  This will be added later when enabling the new threading API.\n- Remove priority enum value \"_UNDEFINED\". NORMAL is used\n  as the default.\n- Fix issue with thread return value.\n\nv13:\n - Fix syntax error in unit tests\n\nv12:\n - Fix freebsd warning about initializer in unit tests\n\nv11:\n - Add unit tests for thread API\n - Rebase\n\nv10:\n - Remove patch no. 10. It will be broken down in subpatches \n   and sent as a different patchset that depends on this one.\n   This is done due to the ABI breaks that would be caused by patch 10.\n - Replace unix/rte_thread.c with common/rte_thread.c\n - Remove initializations that may prevent compiler from issuing useful\n   warnings.\n - Remove rte_thread_types.h and rte_windows_thread_types.h\n - Remove unneeded priority macros (EAL_THREAD_PRIORITY*)\n - Remove functions that retrieves thread handle from process handle\n - Remove rte_thread_cancel() until same behavior is obtained on\n   all platforms.\n - Fix rte_thread_detach() function description,\n   return value and remove empty line.\n - Reimplement mutex functions. Add compatible representation for mutex\n   identifier. Add macro to replace static mutex initialization instances.\n - Fix commit messages (lines too long, remove unicode symbols)\n\nv9:\n- Sign patches\n\nv8:\n- Rebase\n- Add rte_thread_detach() API\n- Set default priority, when user did not specify a value\n\nv7:\nBased on DmitryK's review:\n- Change thread id representation\n- Change mutex id representation\n- Implement static mutex inititalizer for Windows\n- Change barrier identifier representation\n- Improve commit messages\n- Add missing doxygen comments\n- Split error translation function\n- Improve name for affinity function\n- Remove cpuset_size parameter\n- Fix eal_create_cpu_map function\n- Map EAL priority values to OS specific values\n- Add thread wrapper for start routine\n- Do not export rte_thread_cancel() on Windows\n- Cleanup, fix comments, fix typos.\n\nv6:\n- improve error-translation function\n- call the error translation function in rte_thread_value_get()\n\nv5:\n- update cover letter with more details on the priority argument\n\nv4:\n- fix function description\n- rebase\n\nv3:\n- rebase\n\nv2:\n- revert changes that break ABI \n- break up changes into smaller patches\n- fix coding style issues\n- fix issues with errors\n- fix parameter type in examples/kni.c\n\nNarcisa Vasile (8):\n  eal: add basic threading functions\n  eal: add thread attributes\n  eal/windows: translate Windows errors to errno-style errors\n  eal: implement functions for thread affinity management\n  eal: implement thread priority management functions\n  eal: add thread lifetime management\n  eal: implement functions for thread barrier management\n  eal: implement functions for mutex management\n\n app/test/meson.build            |   2 +\n app/test/test_threads.c         | 372 ++++++++++++++++++\n lib/eal/common/meson.build      |   1 +\n lib/eal/common/rte_thread.c     | 511 +++++++++++++++++++++++++\n lib/eal/include/rte_thread.h    | 412 +++++++++++++++++++-\n lib/eal/unix/meson.build        |   1 -\n lib/eal/unix/rte_thread.c       |  92 -----\n lib/eal/version.map             |  22 ++\n lib/eal/windows/eal_lcore.c     | 176 ++++++---\n lib/eal/windows/eal_windows.h   |  10 +\n lib/eal/windows/include/sched.h |   2 +-\n lib/eal/windows/rte_thread.c    | 656 ++++++++++++++++++++++++++++++--\n 12 files changed, 2084 insertions(+), 173 deletions(-)\n create mode 100644 app/test/test_threads.c\n create mode 100644 lib/eal/common/rte_thread.c\n delete mode 100644 lib/eal/unix/rte_thread.c",
    "diff": null,
    "prefixes": [
        "v18",
        "0/8"
    ]
}