Show a cover letter.

GET /api/covers/96480/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 96480,
    "url": "http://patchwork.dpdk.org/api/covers/96480/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/cover/1627684312-28630-1-git-send-email-navasile@linux.microsoft.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1627684312-28630-1-git-send-email-navasile@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1627684312-28630-1-git-send-email-navasile@linux.microsoft.com",
    "date": "2021-07-30T22:31:42",
    "name": "[v11,00/10] eal: Add EAL API for threading",
    "submitter": {
        "id": 1668,
        "url": "http://patchwork.dpdk.org/api/people/1668/?format=api",
        "name": "Narcisa Ana Maria Vasile",
        "email": "navasile@linux.microsoft.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/cover/1627684312-28630-1-git-send-email-navasile@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 18112,
            "url": "http://patchwork.dpdk.org/api/series/18112/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18112",
            "date": "2021-07-30T22:31:42",
            "name": "eal: Add EAL API for threading",
            "version": 11,
            "mbox": "http://patchwork.dpdk.org/series/18112/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/covers/96480/comments/",
    "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 EE2BFA0C40;\n\tSat, 31 Jul 2021 00:31:59 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7127140042;\n\tSat, 31 Jul 2021 00:31:59 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 6D95340040\n for <dev@dpdk.org>; Sat, 31 Jul 2021 00:31:57 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1059)\n id AA10820B36E0; Fri, 30 Jul 2021 15:31:56 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com AA10820B36E0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1627684316;\n bh=i4OYK+bQfXBQGErImA5GIh4XLGFTJpa0EVkLbR0SxIg=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=BZuExudYNOo7vmuCKKQDMSfDP2uYHSEuuCoVC8h47kyA9seyVEaEi12b+fHIpNiZ/\n k9bXKh/WDxI/ECGBJK7yhFvfcy2UMzsx73YqmafmG0mcWwU6h8LzbFkQL0J3nr+zkg\n bMyWkh4WCUpmE4HitgJpzEnQKNAQoPVKkYc+4q9g=",
        "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",
        "Date": "Fri, 30 Jul 2021 15:31:42 -0700",
        "Message-Id": "<1627684312-28630-1-git-send-email-navasile@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1624051606-26779-1-git-send-email-navasile@linux.microsoft.com>",
        "References": "<1624051606-26779-1-git-send-email-navasile@linux.microsoft.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v11 00/10] eal: Add EAL API for threading",
        "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",
        "Sender": "\"dev\" <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. Given that the thread characteristics that are of interest\nfor DPDK applications are affinity and priority, the following structure\nthat represents thread attributes has been defined:\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_attr_set_priority - updates an rte_thread_attr_t object\n                               with a new value for priority\n\nThe user can choose thread priority through an EAL parameter,\nwhen starting an application.  If EAL parameter is not used,\nthe per-platform default value for thread priority is used.\nOtherwise administrator has an option to set one of available options:\n --thread-prio normal\n --thread-prio realtime\n\nExample:\n./dpdk-l2fwd -l 0-3 -n 4 –thread-prio normal -- -q 8 -p ffff\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**\nA translation function that maps Windows error codes to errno-style\nerror codes is provided. \n\n**Future work**\nThe long term plan is for EAL to provide full threading support:\n* Add support for conditional variables\n* Add support for pthread_mutex_trylock\n* Additional functionality offered by pthread_*\n  (such as pthread_setname_np, etc.)\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\n\nNarcisa Vasile (10):\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 mutex management\n  eal: implement functions for thread barrier management\n  eal: add EAL argument for setting thread priority\n  Add unit tests for thread API\n\n app/test/meson.build                |   2 +\n app/test/test_threads.c             | 419 ++++++++++++++++++++\n lib/eal/common/eal_common_options.c |  28 +-\n lib/eal/common/eal_internal_cfg.h   |   2 +\n lib/eal/common/eal_options.h        |   2 +\n lib/eal/common/meson.build          |   1 +\n lib/eal/common/rte_thread.c         | 445 +++++++++++++++++++++\n lib/eal/include/rte_thread.h        | 406 ++++++++++++++++++-\n lib/eal/unix/meson.build            |   1 -\n lib/eal/unix/rte_thread.c           |  92 -----\n lib/eal/version.map                 |  20 +\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        | 588 ++++++++++++++++++++++++++--\n 15 files changed, 2020 insertions(+), 174 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"
}