get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81348,
    "url": "https://patches.dpdk.org/api/patches/81348/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/f9d29234-4837-86b5-605b-cfedf84b2fbd@mayadata.io/",
    "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": "<f9d29234-4837-86b5-605b-cfedf84b2fbd@mayadata.io>",
    "list_archive_url": "https://inbox.dpdk.org/dev/f9d29234-4837-86b5-605b-cfedf84b2fbd@mayadata.io",
    "date": "2020-10-19T09:59:06",
    "name": "[RFC] pthread on Windows",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d06fe2f6da10524f418f04080cd1a8e5e0df0d78",
    "submitter": {
        "id": 1861,
        "url": "https://patches.dpdk.org/api/people/1861/?format=api",
        "name": "Nick Connolly",
        "email": "nick.connolly@mayadata.io"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/f9d29234-4837-86b5-605b-cfedf84b2fbd@mayadata.io/mbox/",
    "series": [
        {
            "id": 13099,
            "url": "https://patches.dpdk.org/api/series/13099/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13099",
            "date": "2020-10-19T09:59:06",
            "name": "[RFC] pthread on Windows",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/13099/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/81348/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/81348/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4CA49A04DC;\n\tMon, 19 Oct 2020 11:59:14 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 11D331C48;\n\tMon, 19 Oct 2020 11:59:13 +0200 (CEST)",
            "from mail-wm1-f68.google.com (mail-wm1-f68.google.com\n [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id E6F5CE07\n for <dev@dpdk.org>; Mon, 19 Oct 2020 11:59:10 +0200 (CEST)",
            "by mail-wm1-f68.google.com with SMTP id k18so12127299wmj.5\n for <dev@dpdk.org>; Mon, 19 Oct 2020 02:59:10 -0700 (PDT)",
            "from [192.168.0.33]\n (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78])\n by smtp.gmail.com with ESMTPSA id t10sm14938160wmf.46.2020.10.19.02.59.06\n for <dev@dpdk.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 19 Oct 2020 02:59:08 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=mayadata-io.20150623.gappssmtp.com; s=20150623;\n h=from:subject:to:message-id:date:user-agent:mime-version\n :content-language;\n bh=DZb3BmE0Q4PuFhHvgjslhu/KusTZFi/Xxq98Q8XMpYU=;\n b=D3t+nWmEOWi2ACeIz6JkSR38CT9u2Y5qc5AaJQ1WSOTdglFJAD2UndiMd4cIlcm1fD\n WHMo/WNM5AMlvD50PUZ4WeMfD0eWo8cnfyicf+L1WF9VGvO9aiZGTs1wSh2JgSi2oye9\n hmouCHgcaS1NEWKLtX4arooZGWe8wiJY6NJEQpojylJ5Y9ga8YYCXMnx6ovZCojHFSNr\n 6wzvtKoQzr0RpSfXlYMZSZ8CkQQfFTN6Eide+5yX33fqq+mmlGe2djGJH24yPlkKn8un\n sC6Ekq0XDNfTYUNqwHCkpPJ3gcMm6H07Sexhoagj81USCpwJH/NsIoy1z3vU+LIAaRKe\n gSMw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:subject:to:message-id:date:user-agent\n :mime-version:content-language;\n bh=DZb3BmE0Q4PuFhHvgjslhu/KusTZFi/Xxq98Q8XMpYU=;\n b=FcfL5GHcnKAGJQ+QLk3uBj+DSuQAf5xEzPUGFVLgbYolCbT1uyQcA18PvEzvuFOBpj\n fOJy9anFWg+EeQ5WLKkBRjPJ10gNFBcgw6pSXx8k9i7Y3AxirRpyCo1/GStdsavr2l/g\n 1Dj02jWOmK8xrjk91oACiZrG7DeWX0VswkHLYa4H6OXT2Lwq2RPrF/SNFawAVuZwCj1I\n nVyce6gBYgy3kETg+pqNMMi/MwBMLChXxPKTypv52R8KMu9VZyj0gACGlUox8PHWSZYV\n 0bHIH2avOCbCm2FiOHL/nE9TRhLII3lTm244Hx30Jo+vqduvlFYTM3tBPIxgt81jnHtG\n E26g==",
        "X-Gm-Message-State": "AOAM530O4yeI2TArgBo7748cPfVYCjuS7/h1dcfMNRnQNPLu9KuCvRBY\n xgggm1wMb8mv85v3uF6gxB9iBDKFKuQrfioF",
        "X-Google-Smtp-Source": "\n ABdhPJw0d1sO+WHFOkMNvoIOZimLTcSLM26zrDfrt3jrO5ycNe0A4rAhP6RGjAC0r1MAfrzSX8bbeg==",
        "X-Received": "by 2002:a1c:5442:: with SMTP id p2mr3077730wmi.128.1603101548927;\n Mon, 19 Oct 2020 02:59:08 -0700 (PDT)",
        "From": "Nick Connolly <nick.connolly@mayadata.io>",
        "X-Google-Original-From": "Nick Connolly <Nick.Connolly@mayadata.io>",
        "To": "dev@dpdk.org",
        "Message-ID": "<f9d29234-4837-86b5-605b-cfedf84b2fbd@mayadata.io>",
        "Date": "Mon, 19 Oct 2020 10:59:06 +0100",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101\n Thunderbird/68.12.1",
        "MIME-Version": "1.0",
        "Content-Language": "en-GB",
        "Content-Type": "text/plain; charset=utf-8; format=flowed",
        "Content-Transfer-Encoding": "8bit",
        "X-Content-Filtered-By": "Mailman/MimeDel 2.1.15",
        "Subject": "[dpdk-dev] [RFC] pthread on Windows",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "As part of the DPDK on Windows work, the following proposal has been put \ntogether and we would welcome community feedback.\n\nThe heart of the issue is that, unlike Linux and FreeBSD, Windows does \nnot claim to be POSIX conformant: some functionality is missing, some is \npresent and some has different semantics.  Support for pthread is \nmissing on Windows and this is currently handled with an EAL header file \nthat wraps the underlying Windows calls.  It only implements \nfunctionality that is actually used by the DPDK and does so in as \nlightweight a way as possible.\n\nThe guidance we have received so far is that the EAL is meant to be an \nisolation layer between the DPDK and the underlying environment, such that:\n\n  * All accesses to the operating system (apart from basic libc\n    functionality) should pass through the EAL.\n  * The DPDK code should have no POSIX dependencies outside of the EAL.\n\nThis means that pthread support needs to be hidden behind a new rte_* \ninterface and the DPDK code must be modified to use it.  As the Windows \nwork progresses there will be other areas of POSIX support that need to \nbe treated in a similar manner.\n\n[As an aside, an alternative would be to decide that there is at least a \npartial implied POSIX dependency in the DPDK code base and the EAL is \nmeant to provide an isolation layer for functionality that is outside of \nthis.  This is the approach taken by WPDK to run SPDK on Windows \n(https://github.com/wpdk/wpdk)]\n\nIn the absence of a Microsoft supported pthread library, there are a \nnumber of projects available that could be used, but they each have \ncompromises and trade-offs.  The support in the EAL maps very closely to \nWindows calls, but only implements a limited subset of functionality.  \nThe proposal includes the option to build the DPDK using an external \nthreads package for applications with more extensive requirements, such \nas condition variables or thread cancellation.\n\nThe proposed changes are:\n\n 1. An EAL implementation of pthread with a new rte_pthread API.\n 2. The DPDK code (libs, examples, drivers, apps, tests, etc) needs to\n    be modified to use the new rte_pthread API.\n 3. There needs to be an option for apps to use an external pthread\n    library as an alternative to the EAL implementation.\n 4. Eventually, apps can opt in to using the rte_pthread API if desired.\n\nItem #3 isn't dependent on #1 and #2 - it can be implemented now, \nallowing forward progress to be made without blocking on #1 and #2 which \nmay take longer to resolve.\n\nThe detailed proposal for #3 is as follows:\n\n 1. Add a meson build option to specify a list of subprojects to be\n    combined with the EAL.\n 2. If no subprojects are specified, then the build should complete\n    exactly as currently, using the support built in to the EAL.\n 3. If a subproject is specified then just the relevant functionality in\n    the EAL is replaced at build time, leaving the rest of the EAL\n    unchanged.\n 4. A subproject can specify the list of headers it provides, overriding\n    the ones in the EAL (e.g. pthreads4w provides pthread.h and sched.h).\n 5. This allows development to continue on the EAL version of pthread\n    and also allows an application to use an external library.\n\nThis can be implemented with only very minor changes to the meson build \nfiles (see the illustrative set of diffs below).\n\nWe would welcome your input on these proposals.\n\nRegards,\nNick (on behalf of DPDK on Windows)\n\n----------------------------------------------------------------------",
    "diff": "diff --git a/app/meson.build b/app/meson.build\nindex eb74f215a..8f415084d 100644\n--- a/app/meson.build\n+++ b/app/meson.build\n@@ -49,6 +49,7 @@ foreach app:apps\n                   + '_rte_' + d)\n          endforeach\n          dep_objs += lib_execinfo\n+        dep_objs += get_variable('eal_' + get_option('default_library') \n+ '_deps')\n\n          link_libs = []\n          if get_option('default_library') == 'static'\ndiff --git a/config/meson.build b/config/meson.build\nindex 69f2aeb60..3554c2f90 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -298,3 +298,13 @@ if get_option('b_lto')\n          add_project_link_arguments('-Wno-lto-type-mismatch', language: \n'c')\n      endif\n  endif\n+\n+# Include EAL dependencies\n+foreach p : get_option('eal_deps')\n+    name = p.strip()\n+    project = subproject(name)\n+    project_dep = project.get_variable(name + '_dep')\n+    eal_shared_deps += project.get_variable(name + 'shared_dep', \nproject_dep)\n+    eal_static_deps += project.get_variable(name + 'static_dep', \nproject_dep)\n+    eal_exclude_list += project.get_variable('eal_header_files', [])\n+endforeach\ndiff --git a/drivers/meson.build b/drivers/meson.build\nindex 5f9526557..7592866c3 100644\n--- a/drivers/meson.build\n+++ b/drivers/meson.build\n@@ -99,6 +99,8 @@ foreach subpath:subdirs\n                      static_deps += [get_variable('static_rte_' + d)]\n                  endif\n              endforeach\n+            shared_deps += eal_shared_deps\n+            static_deps += eal_static_deps\n          endif\n\n          if not build\ndiff --git a/examples/meson.build b/examples/meson.build\nindex 245d98575..6d07c1f2c 100644\n--- a/examples/meson.build\n+++ b/examples/meson.build\n@@ -95,6 +95,7 @@ foreach example: examples\n              endif\n              dep_objs += [get_variable(var_name)]\n          endforeach\n+        dep_objs += get_variable('eal_' + get_option('default_library') \n+ '_deps')\n          if allow_experimental_apis\n              cflags += '-DALLOW_EXPERIMENTAL_API'\n          endif\ndiff --git a/lib/librte_eal/windows/include/eal/meson.build \nb/lib/librte_eal/windows/include/eal/meson.build\nnew file mode 100644\nindex 000000000..75fdbf758\n--- /dev/null\n+++ b/lib/librte_eal/windows/include/eal/meson.build\n@@ -0,0 +1,20 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2020, MayaData Inc. All rights reserved.\n+# Copyright (c) 2020, DataCore Software Corporation. All rights reserved.\n+\n+# Copy the headers to the build directory to implement the exclude list.\n+\n+includes += include_directories('.')\n+\n+foreach h : eal_headers\n+    if not eal_exclude_list.contains(h)\n+        if h.startswith('rte_') or not eal_exclude_list.contains('*')\n+            configure_file(copy: true, input: join_paths('..', h), \noutput: h)\n+        endif\n+    endif\n+endforeach\n+\n+if not eal_exclude_list.contains('*')\n+    subdir('netinet')\n+    subdir('sys')\n+endif\ndiff --git a/lib/librte_eal/windows/include/eal/netinet/meson.build \nb/lib/librte_eal/windows/include/eal/netinet/meson.build\nnew file mode 100644\nindex 000000000..b7722adf9\n--- /dev/null\n+++ b/lib/librte_eal/windows/include/eal/netinet/meson.build\n@@ -0,0 +1,13 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2020, MayaData Inc. All rights reserved.\n+# Copyright (c) 2020, DataCore Software Corporation. All rights reserved.\n+\n+# Copy the headers to the build directory to implement the exclude list.\n+\n+includes += include_directories('.')\n+\n+foreach h : eal_netinet_headers\n+    if not eal_exclude_list.contains('netinet/' + h)\n+        configure_file(copy: true, input: join_paths('../../netinet', \nh), output: h)\n+    endif\n+endforeach\ndiff --git a/lib/librte_eal/windows/include/eal/sys/meson.build \nb/lib/librte_eal/windows/include/eal/sys/meson.build\nnew file mode 100644\nindex 000000000..295c4e7bf\n--- /dev/null\n+++ b/lib/librte_eal/windows/include/eal/sys/meson.build\n@@ -0,0 +1,13 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2020, MayaData Inc. All rights reserved.\n+# Copyright (c) 2020, DataCore Software Corporation. All rights reserved.\n+\n+# Copy the headers to the build directory to implement the exclude list.\n+\n+includes += include_directories('.')\n+\n+foreach h : eal_sys_headers\n+    if not eal_exclude_list.contains('sys/' + h)\n+        configure_file(copy: true, input: join_paths('../../sys', h), \noutput: h)\n+    endif\n+endforeach\ndiff --git a/lib/librte_eal/windows/include/meson.build \nb/lib/librte_eal/windows/include/meson.build\nindex b3534b025..07a747363 100644\n--- a/lib/librte_eal/windows/include/meson.build\n+++ b/lib/librte_eal/windows/include/meson.build\n@@ -1,10 +1,35 @@\n  # SPDX-License-Identifier: BSD-3-Clause\n  # Copyright 2020 Mellanox Technologies, Ltd\n\n-includes += include_directories('.')\n-\n-headers += files(\n+eal_headers = [\n          'rte_os.h',\n          'rte_virt2phys.h',\n          'rte_windows.h',\n-)\n+]\n+\n+headers += files(eal_headers)\n+\n+eal_headers += [\n+        'dirent.h',\n+        'fnmatch.h',\n+        'getopt.h',\n+        'pthread.h',\n+        'regex.h',\n+        'sched.h',\n+        'unistd.h',\n+]\n+\n+eal_sys_headers = [\n+        'queue.h',\n+]\n+\n+eal_netinet_headers = [\n+        'in.h',\n+        'ip.h',\n+]\n+\n+if eal_exclude_list.length() == 0\n+        includes += include_directories('.')\n+else\n+        subdir('eal')\n+endif\ndiff --git a/lib/meson.build b/lib/meson.build\nindex e5597f174..b4cf1b07c 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -91,6 +91,8 @@ foreach l:libraries\n              shared_deps += [get_variable('shared_rte_' + d)]\n              static_deps += [get_variable('static_rte_' + d)]\n          endforeach\n+        shared_deps += eal_shared_deps\n+        static_deps += eal_static_deps\n      endif\n\n      if not build\ndiff --git a/meson.build b/meson.build\nindex 61d9a4f5f..13f50517f 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -21,6 +21,9 @@ dpdk_drivers = []\n  dpdk_extra_ldflags = []\n  dpdk_libs_disabled = []\n  dpdk_drvs_disabled = []\n+eal_shared_deps = []\n+eal_static_deps = []\n+eal_exclude_list = []\n  abi_version_file = files('ABI_VERSION')\n\n  if host_machine.cpu_family().startswith('x86')\n@@ -31,19 +34,20 @@ elif host_machine.cpu_family().startswith('ppc')\n      arch_subdir = 'ppc'\n  endif\n\n+# do configuration and get tool paths\n+subdir('buildtools')\n+subdir('config')\n+\n  # configure the build, and make sure configs here and in config folder are\n  # able to be included in any file. We also store a global array of \ninclude dirs\n  # for passing to pmdinfogen scripts\n  global_inc = include_directories('.', 'config',\n      'lib/librte_eal/include',\n-    'lib/librte_eal/@0@/include'.format(host_machine.system()),\n+    'lib/librte_eal/@0@/include@1@'.format(host_machine.system(),\n+        (eal_exclude_list.length() != 0) ? '/eal' : ''),\n      'lib/librte_eal/@0@/include'.format(arch_subdir),\n  )\n\n-# do configuration and get tool paths\n-subdir('buildtools')\n-subdir('config')\n-\n  # build libs and drivers\n  subdir('buildtools/pmdinfogen')\n  subdir('lib')\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 9bf18ab6b..b28eb8ba3 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -6,6 +6,8 @@ option('disable_drivers', type: 'string', value: '',\n      description: 'Comma-separated list of drivers to explicitly disable.')\n  option('drivers_install_subdir', type: 'string', value: \n'dpdk/pmds-<VERSION>',\n      description: 'Subdirectory of libdir where to install PMDs. \nDefaults to using a versioned subdirectory.')\n+option('eal_deps', type: 'array', value: [],\n+    description: 'Environment Abstraction Layer dependencies')\n  option('enable_docs', type: 'boolean', value: false,\n      description: 'build documentation')\n  option('enable_kmods', type: 'boolean', value: false,\ndiff --git a/subprojects/test/meson.build b/subprojects/test/meson.build\nnew file mode 100644\nindex 000000000..911626f23\n--- /dev/null\n+++ b/subprojects/test/meson.build\n@@ -0,0 +1,31 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2020, MayaData Inc. All rights reserved.\n+# Copyright (c) 2020, DataCore Software Corporation. All rights reserved.\n+\n+project('TEST', 'C',\n+    version: '0.0.0',\n+    license: 'BSD',\n+    default_options: ['buildtype=release','default_library=static'],\n+    meson_version: '>= 0.47.1'\n+)\n+\n+cc = meson.get_compiler('c')\n+\n+includes = include_directories('.')\n+\n+eal_header_files =[\n+    'pthread.h',\n+    'sched.h',\n+]\n+\n+test_static_dep = declare_dependency(\n+    include_directories : includes,\n+    link_args : [ '-lws2_32', '-lrpcrt4' ],\n+)\n+\n+test_shared_dep = declare_dependency(\n+    include_directories : includes,\n+    link_args : [ '-lws2_32', '-lrpcrt4' ],\n+)\n+\n+test_dep = test_static_dep\n",
    "prefixes": [
        "RFC"
    ]
}