Show a cover letter.

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

{
    "id": 93923,
    "url": "http://patches.dpdk.org/api/covers/93923/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/cover/1622850274-6946-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": "<1622850274-6946-1-git-send-email-navasile@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1622850274-6946-1-git-send-email-navasile@linux.microsoft.com",
    "date": "2021-06-04T23:44:24",
    "name": "[v9,00/10] eal: Add EAL API for threading",
    "submitter": {
        "id": 1668,
        "url": "http://patches.dpdk.org/api/people/1668/?format=api",
        "name": "Narcisa Ana Maria Vasile",
        "email": "navasile@linux.microsoft.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/cover/1622850274-6946-1-git-send-email-navasile@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 17241,
            "url": "http://patches.dpdk.org/api/series/17241/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=17241",
            "date": "2021-06-04T23:44:24",
            "name": "eal: Add EAL API for threading",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/17241/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/covers/93923/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 ED9ACA0A0F;\n\tSat,  5 Jun 2021 01:44:38 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6E4CD4067B;\n\tSat,  5 Jun 2021 01:44:38 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id E65A040147\n for <dev@dpdk.org>; Sat,  5 Jun 2021 01:44:36 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1059)\n id 3C6CF20B7188; Fri,  4 Jun 2021 16:44:36 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 3C6CF20B7188",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1622850276;\n bh=7zjICXsuglzDmO1Izjw1N48V0BmotmFQeMRGXJFRUZI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=eBY2PhCB94gcvWFybuY3XP73wMDOFjEdzQGZYqawFmFunddD4QcxZ5+Eq683ZqSpI\n U5knuayDW5DBHHFuS4zUvAkblBvvaSKZnu/er3JolHLjzY8SBJunolb1Drbp/TXgd3\n WTzH1nbKEgNepMHv4JLn7jqXeCatnAwZuVNWnEvM=",
        "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,  4 Jun 2021 16:44:24 -0700",
        "Message-Id": "<1622850274-6946-1-git-send-email-navasile@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1622849908-5710-1-git-send-email-navasile@linux.microsoft.com>",
        "References": "<1622849908-5710-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 v9 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, so 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_types.h (librte_eal/include)\n* rte_thread_windows_types.h (librte_eal/windows/include)\n* rte_thread.c (librte_eal/windows)\n* rte_thread.c (librte_eal/common)\n\nFor flexibility, the user is offered the option of either using the RTE_THREAD_* API or\na 3rd party thread library, through a meson flag “use_external_thread_lib”.\nBy default, this flag is set to FALSE, which means Windows libraries and applications\nwill use the RTE_THREAD_* API for managing threads.\n\nIf compiling on Windows and the “use_external_thread_lib” is *not* set,\nthe following files will be parsed: \n* include/rte_thread.h\n* windows/include/rte_thread_windows_types.h\n* windows/rte_thread.c\nIn all other cases, the compilation/parsing includes the following files:\n* include/rte_thread.h \n* include/rte_thread_types.h\n* common/rte_thread.c\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\nlib/librte_eal/windows/meson.build\nif get_option('use_external_thread_lib')\n\tsources += 'librte_eal/common/rte_thread.c'\nelse\n\tsources += 'librte_eal/windows/rte_thread.c'\nendif\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 an rte_thread_attr_t\nobject that will cause the thread to be created with the affinity 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**\nNote that this patchset was focused on introducing new API that will\nremove the Windows pthread.h shim. In DPDK, there are still a few references\nto pthread_* that were not implemented in the shim.\nThe long term plan is for EAL to provide full threading support:\n* Adding support for conditional variables\n* Additional functionality offered by pthread_* (such as pthread_setname_np, etc.)\n* Static mutex initializers are not used on Windows. If we must continue\n  using them, they need to be platform dependent and an implementation will\n  need to be provided for Windows.\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 (10):\n  eal: add thread id and simple thread 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  Enable the new EAL thread API\n\n app/test/process.h                            |   8 +-\n app/test/test_lcores.c                        |  16 +-\n app/test/test_link_bonding.c                  |  10 +-\n app/test/test_lpm_perf.c                      |  12 +-\n config/meson.build                            |   4 +\n drivers/bus/dpaa/base/qbman/bman_driver.c     |   5 +-\n drivers/bus/dpaa/base/qbman/dpaa_sys.c        |  14 +-\n drivers/bus/dpaa/base/qbman/process.c         |   6 +-\n drivers/bus/dpaa/dpaa_bus.c                   |  14 +-\n drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |  19 +-\n drivers/compress/mlx5/mlx5_compress.c         |  10 +-\n drivers/event/dlb2/pf/base/dlb2_osdep.h       |   4 +-\n drivers/net/af_xdp/rte_eth_af_xdp.c           |  18 +-\n drivers/net/ark/ark_ethdev.c                  |   2 +-\n drivers/net/ark/ark_pktgen.c                  |   4 +-\n drivers/net/atlantic/atl_ethdev.c             |   4 +-\n drivers/net/atlantic/atl_types.h              |   5 +-\n .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   |  26 +-\n drivers/net/axgbe/axgbe_common.h              |   2 +-\n drivers/net/axgbe/axgbe_dev.c                 |   8 +-\n drivers/net/axgbe/axgbe_ethdev.c              |   8 +-\n drivers/net/axgbe/axgbe_ethdev.h              |   8 +-\n drivers/net/axgbe/axgbe_i2c.c                 |   4 +-\n drivers/net/axgbe/axgbe_mdio.c                |   8 +-\n drivers/net/axgbe/axgbe_phy_impl.c            |   6 +-\n drivers/net/bnxt/bnxt.h                       |  16 +-\n drivers/net/bnxt/bnxt_cpr.c                   |   4 +-\n drivers/net/bnxt/bnxt_ethdev.c                |  52 +-\n drivers/net/bnxt/bnxt_irq.c                   |   8 +-\n drivers/net/bnxt/bnxt_reps.c                  |  10 +-\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  34 +-\n drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   4 +-\n drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |  24 +-\n drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h          |   2 +-\n drivers/net/ena/base/ena_plat_dpdk.h          |  12 +-\n drivers/net/enic/enic.h                       |   2 +-\n drivers/net/ice/ice_dcf_parent.c              |   6 +-\n drivers/net/ipn3ke/ipn3ke_representor.c       |   6 +-\n drivers/net/ixgbe/ixgbe_ethdev.c              |   2 +-\n drivers/net/ixgbe/ixgbe_ethdev.h              |   2 +-\n drivers/net/kni/rte_eth_kni.c                 |   8 +-\n drivers/net/mlx5/linux/mlx5_os.c              |   2 +-\n drivers/net/mlx5/mlx5.c                       |  20 +-\n drivers/net/mlx5/mlx5.h                       |   2 +-\n drivers/net/mlx5/mlx5_txpp.c                  |   8 +-\n drivers/net/mlx5/windows/mlx5_flow_os.c       |  10 +-\n drivers/net/mlx5/windows/mlx5_os.c            |   2 +-\n drivers/net/qede/base/bcm_osal.h              |   8 +-\n drivers/net/vhost/rte_eth_vhost.c             |  24 +-\n .../net/virtio/virtio_user/virtio_user_dev.c  |  30 +-\n .../net/virtio/virtio_user/virtio_user_dev.h  |   2 +-\n drivers/raw/ifpga/ifpga_rawdev.c              |   6 +-\n drivers/vdpa/ifc/ifcvf_vdpa.c                 |  46 +-\n drivers/vdpa/mlx5/mlx5_vdpa.c                 |  24 +-\n drivers/vdpa/mlx5/mlx5_vdpa.h                 |   4 +-\n drivers/vdpa/mlx5/mlx5_vdpa_event.c           |  46 +-\n examples/kni/main.c                           |   6 +-\n .../performance-thread/pthread_shim/main.c    |   2 +-\n examples/vhost/main.c                         |   2 +-\n examples/vhost_blk/vhost_blk.c                |  12 +-\n lib/eal/common/eal_common_options.c           |  34 +-\n lib/eal/common/eal_common_proc.c              |  48 +-\n lib/eal/common/eal_common_thread.c            |  42 +-\n lib/eal/common/eal_common_trace.c             |   2 +-\n lib/eal/common/eal_internal_cfg.h             |   2 +\n lib/eal/common/eal_options.h                  |   2 +\n lib/eal/common/eal_private.h                  |   2 +-\n lib/eal/common/eal_thread.h                   |   6 +\n lib/eal/common/malloc_mp.c                    |  32 +-\n lib/eal/common/meson.build                    |   1 +\n lib/eal/common/rte_thread.c                   | 422 +++++++++++\n lib/eal/freebsd/eal.c                         |  42 +-\n lib/eal/freebsd/eal_alarm.c                   |  12 +-\n lib/eal/freebsd/eal_interrupts.c              |   4 +-\n lib/eal/freebsd/eal_thread.c                  |  14 +-\n lib/eal/include/meson.build                   |   1 +\n lib/eal/include/rte_lcore.h                   |   8 +-\n lib/eal/include/rte_per_lcore.h               |   2 -\n lib/eal/include/rte_thread.h                  | 378 +++++++++-\n lib/eal/include/rte_thread_types.h            |  14 +\n lib/eal/linux/eal.c                           |  46 +-\n lib/eal/linux/eal_alarm.c                     |  10 +-\n lib/eal/linux/eal_interrupts.c                |   4 +-\n lib/eal/linux/eal_thread.c                    |  18 +-\n lib/eal/linux/eal_timer.c                     |   2 +-\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.c                         |  43 +-\n lib/eal/windows/eal_interrupts.c              |  10 +-\n lib/eal/windows/eal_lcore.c                   | 169 +++--\n lib/eal/windows/eal_thread.c                  |  28 +-\n lib/eal/windows/eal_windows.h                 |  20 +-\n lib/eal/windows/include/meson.build           |   1 +\n lib/eal/windows/include/pthread.h             | 192 -----\n .../include/rte_windows_thread_types.h        |  19 +\n lib/eal/windows/include/sched.h               |   2 +-\n lib/eal/windows/meson.build                   |   7 +-\n lib/eal/windows/rte_thread.c                  | 678 +++++++++++++++++-\n lib/ethdev/rte_ethdev.c                       |   4 +-\n lib/ethdev/rte_ethdev_core.h                  |   5 +-\n lib/ethdev/rte_flow.c                         |   4 +-\n lib/eventdev/rte_event_eth_rx_adapter.c       |   6 +-\n lib/vhost/fd_man.c                            |  40 +-\n lib/vhost/fd_man.h                            |   6 +-\n lib/vhost/socket.c                            | 130 ++--\n lib/vhost/vhost.c                             |  10 +-\n meson_options.txt                             |   2 +\n 108 files changed, 2345 insertions(+), 967 deletions(-)\n create mode 100644 lib/eal/common/rte_thread.c\n create mode 100644 lib/eal/include/rte_thread_types.h\n delete mode 100644 lib/eal/unix/rte_thread.c\n delete mode 100644 lib/eal/windows/include/pthread.h\n create mode 100644 lib/eal/windows/include/rte_windows_thread_types.h"
}