get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2609,
    "url": "https://patches.dpdk.org/api/patches/2609/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1422428365-5875-4-git-send-email-cunming.liang@intel.com/",
    "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": "<1422428365-5875-4-git-send-email-cunming.liang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1422428365-5875-4-git-send-email-cunming.liang@intel.com",
    "date": "2015-01-28T06:59:13",
    "name": "[dpdk-dev,v2,03/15] eal: add support parsing socket_id from cpuset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6e3370024653f86c7244edff23565931891823f8",
    "submitter": {
        "id": 46,
        "url": "https://patches.dpdk.org/api/people/46/?format=api",
        "name": "Cunming Liang",
        "email": "cunming.liang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1422428365-5875-4-git-send-email-cunming.liang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2609/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2609/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 51C7E5A97;\n\tWed, 28 Jan 2015 08:00:13 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 8E4A35A7A\n\tfor <dev@dpdk.org>; Wed, 28 Jan 2015 07:59:58 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 27 Jan 2015 22:53:48 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 27 Jan 2015 22:46:11 -0800",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t0S6xr4O023702;\n\tWed, 28 Jan 2015 14:59:53 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t0S6xo6Q005950; Wed, 28 Jan 2015 14:59:52 +0800",
            "(from cliang18@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0S6xosm005946; \n\tWed, 28 Jan 2015 14:59:50 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"446231325\"",
        "From": "Cunming Liang <cunming.liang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 28 Jan 2015 14:59:13 +0800",
        "Message-Id": "<1422428365-5875-4-git-send-email-cunming.liang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1422428365-5875-1-git-send-email-cunming.liang@intel.com>",
        "References": "<1421914598-2747-1-git-send-email-cunming.liang@intel.com>\n\t<1422428365-5875-1-git-send-email-cunming.liang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 03/15] eal: add support parsing socket_id from\n\tcpuset",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "It returns the socket_id if all cpus in the cpuset belongs\nto the same NUMA node, otherwise it will return SOCKET_ID_ANY.\n\nSigned-off-by: Cunming Liang <cunming.liang@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal_lcore.c   |  7 +++++\n lib/librte_eal/common/eal_thread.h      | 52 +++++++++++++++++++++++++++++++++\n lib/librte_eal/linuxapp/eal/eal_lcore.c |  7 +++++\n 3 files changed, 66 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_lcore.c b/lib/librte_eal/bsdapp/eal/eal_lcore.c\nindex 72f8ac2..162fb4f 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_lcore.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_lcore.c\n@@ -41,6 +41,7 @@\n #include <rte_debug.h>\n \n #include \"eal_private.h\"\n+#include \"eal_thread.h\"\n \n /* No topology information available on FreeBSD including NUMA info */\n #define cpu_core_id(X) 0\n@@ -112,3 +113,9 @@ rte_eal_cpu_init(void)\n \n \treturn 0;\n }\n+\n+unsigned\n+eal_cpu_socket_id(__rte_unused unsigned cpu_id)\n+{\n+\treturn cpu_socket_id(cpu_id);\n+}\ndiff --git a/lib/librte_eal/common/eal_thread.h b/lib/librte_eal/common/eal_thread.h\nindex b53b84d..a25ee86 100644\n--- a/lib/librte_eal/common/eal_thread.h\n+++ b/lib/librte_eal/common/eal_thread.h\n@@ -34,6 +34,10 @@\n #ifndef EAL_THREAD_H\n #define EAL_THREAD_H\n \n+#include <sched.h>\n+\n+#include <rte_debug.h>\n+\n /**\n  * basic loop of thread, called for each thread by eal_init().\n  *\n@@ -50,4 +54,52 @@ __attribute__((noreturn)) void *eal_thread_loop(void *arg);\n  */\n void eal_thread_init_master(unsigned lcore_id);\n \n+/**\n+ * Get the NUMA socket id from cpu id.\n+ * This function is private to EAL.\n+ *\n+ * @param cpu_id\n+ *   The logical process id.\n+ * @return\n+ *   socket_id or SOCKET_ID_ANY\n+ */\n+unsigned eal_cpu_socket_id(unsigned cpu_id);\n+\n+/**\n+ * Get the NUMA socket id from cpuset.\n+ * This function is private to EAL.\n+ *\n+ * @param cpusetp\n+ *   The point to a valid cpu set.\n+ * @return\n+ *   socket_id or SOCKET_ID_ANY\n+ */\n+static inline int\n+eal_cpuset_socket_id(rte_cpuset_t *cpusetp)\n+{\n+\tunsigned cpu = 0;\n+\tint socket_id = SOCKET_ID_ANY;\n+\tint sid;\n+\n+\tif (cpusetp == NULL)\n+\t\treturn SOCKET_ID_ANY;\n+\n+\tdo {\n+\t\tif (!CPU_ISSET(cpu, cpusetp))\n+\t\t\tcontinue;\n+\n+\t\tif (socket_id == SOCKET_ID_ANY)\n+\t\t\tsocket_id = eal_cpu_socket_id(cpu);\n+\n+\t\tsid = eal_cpu_socket_id(cpu);\n+\t\tif (socket_id != sid) {\n+\t\t\tsocket_id = SOCKET_ID_ANY;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t} while (++cpu < RTE_MAX_LCORE);\n+\n+\treturn socket_id;\n+}\n+\n #endif /* EAL_THREAD_H */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_lcore.c b/lib/librte_eal/linuxapp/eal/eal_lcore.c\nindex 29615f8..922af6d 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_lcore.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_lcore.c\n@@ -45,6 +45,7 @@\n \n #include \"eal_private.h\"\n #include \"eal_filesystem.h\"\n+#include \"eal_thread.h\"\n \n #define SYS_CPU_DIR \"/sys/devices/system/cpu/cpu%u\"\n #define CORE_ID_FILE \"topology/core_id\"\n@@ -197,3 +198,9 @@ rte_eal_cpu_init(void)\n \n \treturn 0;\n }\n+\n+unsigned\n+eal_cpu_socket_id(unsigned cpu_id)\n+{\n+\treturn cpu_socket_id(cpu_id);\n+}\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "03/15"
    ]
}