get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65648,
    "url": "http://patches.dpdk.org/api/patches/65648/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200207031437.9124-6-pallavi.kadam@intel.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": "<20200207031437.9124-6-pallavi.kadam@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200207031437.9124-6-pallavi.kadam@intel.com",
    "date": "2020-02-07T03:14:33",
    "name": "[v8,5/9] eal: add function to detect process type",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ffa5b207bff4a8da73791b2a067888c867889da2",
    "submitter": {
        "id": 1177,
        "url": "http://patches.dpdk.org/api/people/1177/?format=api",
        "name": "Kadam, Pallavi",
        "email": "pallavi.kadam@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200207031437.9124-6-pallavi.kadam@intel.com/mbox/",
    "series": [
        {
            "id": 8457,
            "url": "http://patches.dpdk.org/api/series/8457/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8457",
            "date": "2020-02-07T03:14:28",
            "name": "Windows patchset with additional EAL functionalities",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/8457/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65648/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/65648/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 2D3E5A0541;\n\tFri,  7 Feb 2020 04:16:38 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8269D1C0D1;\n\tFri,  7 Feb 2020 04:16:06 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id 237801C07F\n for <dev@dpdk.org>; Fri,  7 Feb 2020 04:15:56 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 06 Feb 2020 19:15:53 -0800",
            "from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain)\n ([10.166.188.75])\n by orsmga005.jf.intel.com with ESMTP; 06 Feb 2020 19:15:53 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,411,1574150400\"; d=\"scan'208\";a=\"404693005\"",
        "From": "Pallavi Kadam <pallavi.kadam@intel.com>",
        "To": "dev@dpdk.org,\n\tthomas@monjalon.net",
        "Cc": "Harini.Ramakrishnan@microsoft.com, keith.wiles@intel.com,\n bruce.richardson@intel.com, david.marchand@redhat.com,\n jerinjacobk@gmail.com, ranjit.menon@intel.com,\n antara.ganesh.kolar@intel.com, pallavi.kadam@intel.com",
        "Date": "Thu,  6 Feb 2020 19:14:33 -0800",
        "Message-Id": "<20200207031437.9124-6-pallavi.kadam@intel.com>",
        "X-Mailer": "git-send-email 2.18.0.windows.1",
        "In-Reply-To": "<20200207031437.9124-1-pallavi.kadam@intel.com>",
        "References": "<20200201000406.11060-1-pallavi.kadam@intel.com>\n <20200207031437.9124-1-pallavi.kadam@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 5/9] eal: add function to detect process type",
        "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": "Adding a function to detect process type, also included\nheader files to contain suitable function declarations\nand to support extra warning flags.\n\nSigned-off-by: Pallavi Kadam <pallavi.kadam@intel.com>\nSigned-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>\nReviewed-by: Ranjit Menon <ranjit.menon@intel.com>\nReviewed-by: Keith Wiles <keith.wiles@intel.com>\n---\n lib/librte_eal/windows/eal/eal.c        | 61 ++++++++++++++++++++++++-\n lib/librte_eal/windows/eal/eal_debug.c  |  1 +\n lib/librte_eal/windows/eal/eal_lcore.c  |  3 ++\n lib/librte_eal/windows/eal/eal_thread.c | 11 +++++\n 4 files changed, 75 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c\nindex ce460481f..6a1208c35 100644\n--- a/lib/librte_eal/windows/eal/eal.c\n+++ b/lib/librte_eal/windows/eal/eal.c\n@@ -2,21 +2,48 @@\n  * Copyright(c) 2019 Intel Corporation\n  */\n \n+#include <sys/stat.h>\n #include <io.h>\n #include <fcntl.h>\n #include <rte_debug.h>\n #include <rte_eal.h>\n+#include <eal_memcfg.h>\n #include <rte_errno.h>\n #include <rte_lcore.h>\n #include <eal_thread.h>\n+#include <eal_internal_cfg.h>\n+#include <eal_filesystem.h>\n+#include <eal_options.h>\n #include <eal_private.h>\n \n+/* define fd variable here, because file needs to be kept open for the\n+ * duration of the program, as we hold a write lock on it in the primary proc\n+ */\n+static int mem_cfg_fd = -1;\n+\n+/* early configuration structure, when memory config is not mmapped */\n+static struct rte_mem_config early_mem_config;\n+\n /* Address of global and public configuration */\n-static struct rte_config rte_config;\n+static struct rte_config rte_config = {\n+\t\t.mem_config = &early_mem_config,\n+};\n \n /* internal configuration (per-core) */\n struct lcore_config lcore_config[RTE_MAX_LCORE];\n \n+/* internal configuration */\n+struct internal_config internal_config;\n+\n+/* platform-specific runtime dir */\n+static char runtime_dir[PATH_MAX];\n+\n+const char *\n+rte_eal_get_runtime_dir(void)\n+{\n+\treturn runtime_dir;\n+}\n+\n /* Return a pointer to the configuration structure */\n struct rte_config *\n rte_eal_get_configuration(void)\n@@ -24,6 +51,38 @@ rte_eal_get_configuration(void)\n \treturn &rte_config;\n }\n \n+/* Detect if we are a primary or a secondary process */\n+enum rte_proc_type_t\n+eal_proc_type_detect(void)\n+{\n+\tenum rte_proc_type_t ptype = RTE_PROC_PRIMARY;\n+\tconst char *pathname = eal_runtime_config_path();\n+\n+\t/* if we can open the file but not get a write-lock we are a secondary\n+\t * process. NOTE: if we get a file handle back, we keep that open\n+\t * and don't close it to prevent a race condition between multiple opens\n+\t */\n+\terrno_t err = _sopen_s(&mem_cfg_fd, pathname,\n+\t\t_O_RDWR, _SH_DENYNO, _S_IREAD | _S_IWRITE);\n+\tif (err == 0) {\n+\t\tOVERLAPPED soverlapped = { 0 };\n+\t\tsoverlapped.Offset = sizeof(*rte_config.mem_config);\n+\t\tsoverlapped.OffsetHigh = 0;\n+\n+\t\tHANDLE hwinfilehandle = (HANDLE)_get_osfhandle(mem_cfg_fd);\n+\n+\t\tif (!LockFileEx(hwinfilehandle,\n+\t\t\tLOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0,\n+\t\t\tsizeof(*rte_config.mem_config), 0, &soverlapped))\n+\t\t\tptype = RTE_PROC_SECONDARY;\n+\t}\n+\n+\tRTE_LOG(INFO, EAL, \"Auto-detected process type: %s\\n\",\n+\t\tptype == RTE_PROC_PRIMARY ? \"PRIMARY\" : \"SECONDARY\");\n+\n+\treturn ptype;\n+}\n+\n static int\n sync_func(void *arg __rte_unused)\n {\ndiff --git a/lib/librte_eal/windows/eal/eal_debug.c b/lib/librte_eal/windows/eal/eal_debug.c\nindex edcf257cc..669be6ff9 100644\n--- a/lib/librte_eal/windows/eal/eal_debug.c\n+++ b/lib/librte_eal/windows/eal/eal_debug.c\n@@ -4,6 +4,7 @@\n \n #include <stdarg.h>\n #include <rte_log.h>\n+#include <rte_debug.h>\n \n  /* call abort(), it will generate a coredump if enabled */\n void\ndiff --git a/lib/librte_eal/windows/eal/eal_lcore.c b/lib/librte_eal/windows/eal/eal_lcore.c\nindex d39f348a3..b3a6c63af 100644\n--- a/lib/librte_eal/windows/eal/eal_lcore.c\n+++ b/lib/librte_eal/windows/eal/eal_lcore.c\n@@ -6,6 +6,9 @@\n \n #include <rte_common.h>\n \n+#include \"eal_private.h\"\n+#include \"eal_thread.h\"\n+\n /* global data structure that contains the CPU map */\n static struct _wcpu_map {\n \tunsigned int total_procs;\ndiff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c\nindex 0591d4c7f..9e4bbaa08 100644\n--- a/lib/librte_eal/windows/eal/eal_thread.c\n+++ b/lib/librte_eal/windows/eal/eal_thread.c\n@@ -10,11 +10,14 @@\n #include <rte_lcore.h>\n #include <rte_per_lcore.h>\n #include <rte_common.h>\n+#include <rte_memory.h>\n #include <eal_thread.h>\n \n #include \"eal_private.h\"\n \n RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;\n+RTE_DEFINE_PER_LCORE(unsigned int, _socket_id) = (unsigned int)SOCKET_ID_ANY;\n+RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset);\n \n /*\n  * Send a message to a slave lcore identified by slave_id to call a\n@@ -152,3 +155,11 @@ eal_thread_create(pthread_t *thread)\n \n \treturn 0;\n }\n+\n+int\n+rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)\n+{\n+\t/* TODO */\n+\t/* This is a stub, not the expected result */\n+\treturn 0;\n+}\n",
    "prefixes": [
        "v8",
        "5/9"
    ]
}