get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42499,
    "url": "http://patchwork.dpdk.org/api/patches/42499/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/603dcc865358cc669cba9ec042db93e32a4c8cd5.1530881548.git.anatoly.burakov@intel.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": "<603dcc865358cc669cba9ec042db93e32a4c8cd5.1530881548.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/603dcc865358cc669cba9ec042db93e32a4c8cd5.1530881548.git.anatoly.burakov@intel.com",
    "date": "2018-07-06T13:17:23",
    "name": "[RFC,02/11] eal: add function to rerieve socket index by socket ID",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fac0aec407955a203b9e7d7774c56f99b9a84b9b",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/603dcc865358cc669cba9ec042db93e32a4c8cd5.1530881548.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 453,
            "url": "http://patchwork.dpdk.org/api/series/453/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=453",
            "date": "2018-07-06T13:17:21",
            "name": "Support externally allocated memory in DPDK",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/453/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/42499/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/42499/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3DF491BEC1;\n\tFri,  6 Jul 2018 15:17:41 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 296591BE43\n\tfor <dev@dpdk.org>; Fri,  6 Jul 2018 15:17:36 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t06 Jul 2018 06:17:35 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 06 Jul 2018 06:17:33 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw66DHXal027472; Fri, 6 Jul 2018 14:17:33 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w66DHXFe003754;\n\tFri, 6 Jul 2018 14:17:33 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w66DHXnI003749;\n\tFri, 6 Jul 2018 14:17:33 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,316,1526367600\"; d=\"scan'208\";a=\"238320016\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "srinath.mannam@broadcom.com, scott.branden@broadcom.com,\n\tajit.khaparde@broadcom.com",
        "Date": "Fri,  6 Jul 2018 14:17:23 +0100",
        "Message-Id": "<603dcc865358cc669cba9ec042db93e32a4c8cd5.1530881548.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1530881548.git.anatoly.burakov@intel.com>",
            "<cover.1530881548.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1530881548.git.anatoly.burakov@intel.com>",
            "<cover.1530881548.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [RFC 02/11] eal: add function to rerieve socket index by\n\tsocket ID",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "We are preparing to switch to index heap based on heap indexes\nrather than by NUMA nodes. First few indexes will be equal to\nNUMA node ID indexes. For example, currently on a machine with\nNUMA nodes [0, 8], heaps 0 and 8 will be active, while we want\nto make it so that heaps 0 and 1 are active. However, currently\nwe don't have a function to map a specific NUMA node to a node\nindex, so add it in this patch.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_lcore.c  | 15 +++++++++++++++\n lib/librte_eal/common/include/rte_lcore.h | 19 ++++++++++++++++++-\n lib/librte_eal/rte_eal_version.map        |  1 +\n 3 files changed, 34 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 3167e9d79..579f5a0a1 100644\n--- a/lib/librte_eal/common/eal_common_lcore.c\n+++ b/lib/librte_eal/common/eal_common_lcore.c\n@@ -132,3 +132,18 @@ rte_socket_id_by_idx(unsigned int idx)\n \t}\n \treturn config->numa_nodes[idx];\n }\n+\n+int __rte_experimental\n+rte_socket_idx_by_id(unsigned int socket)\n+{\n+\tconst struct rte_config *config = rte_eal_get_configuration();\n+\tint i;\n+\n+\tfor (i = 0; i < (int) config->numa_node_count; i++) {\n+\t\tunsigned int cur_socket = config->numa_nodes[i];\n+\t\tif (cur_socket == socket)\n+\t\t\treturn i;\n+\t}\n+\trte_errno = EINVAL;\n+\treturn -1;\n+}\ndiff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h\nindex 6e09d9181..f58cda09a 100644\n--- a/lib/librte_eal/common/include/rte_lcore.h\n+++ b/lib/librte_eal/common/include/rte_lcore.h\n@@ -156,11 +156,28 @@ rte_socket_count(void);\n  *\n  * @return\n  *   - physical socket id as recognized by EAL\n- *   - -1 on error, with errno set to EINVAL\n+ *   - -1 on error, with rte_errno set to EINVAL\n  */\n int __rte_experimental\n rte_socket_id_by_idx(unsigned int idx);\n \n+/**\n+ * Return index for a particular socket id.\n+ *\n+ * This will return position in list of all detected physical socket id's for a\n+ * given socket. For example, on a machine with sockets [0, 8], passing\n+ * 8 as a parameter will return 1.\n+ *\n+ * @param socket\n+ *   physical socket id to return index for\n+ *\n+ * @return\n+ *   - index of physical socket id as recognized by EAL\n+ *   - -1 on error, with rte_errno set to EINVAL\n+ */\n+int __rte_experimental\n+rte_socket_idx_by_id(unsigned int socket);\n+\n /**\n  * Get the ID of the physical socket of the specified lcore\n  *\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex f7dd0e7bc..e7fb37b2a 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -296,6 +296,7 @@ EXPERIMENTAL {\n \trte_mp_sendmsg;\n \trte_socket_count;\n \trte_socket_id_by_idx;\n+\trte_socket_idx_by_id;\n \trte_vfio_dma_map;\n \trte_vfio_dma_unmap;\n \trte_vfio_get_container_fd;\n",
    "prefixes": [
        "RFC",
        "02/11"
    ]
}