get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53958,
    "url": "http://patches.dpdk.org/api/patches/53958/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559317022-28779-3-git-send-email-david.marchand@redhat.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": "<1559317022-28779-3-git-send-email-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559317022-28779-3-git-send-email-david.marchand@redhat.com",
    "date": "2019-05-31T15:36:59",
    "name": "[v5,2/5] eal: add lcore accessors",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b37c9782633c3f224150085ba73fd1ce7e9c0b10",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1559317022-28779-3-git-send-email-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 4839,
            "url": "http://patches.dpdk.org/api/series/4839/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4839",
            "date": "2019-05-31T15:36:57",
            "name": "make lcore_config internal",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/4839/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53958/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/53958/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 186AF1B964;\n\tFri, 31 May 2019 17:37:17 +0200 (CEST)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id F2E041B964\n\tfor <dev@dpdk.org>; Fri, 31 May 2019 17:37:15 +0200 (CEST)",
            "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5C4738666D;\n\tFri, 31 May 2019 15:37:15 +0000 (UTC)",
            "from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com\n\t[10.36.116.185])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id C6A2960BF7;\n\tFri, 31 May 2019 15:37:13 +0000 (UTC)"
        ],
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, stephen@networkplumber.org,\n\tbruce.richardson@intel.com",
        "Date": "Fri, 31 May 2019 17:36:59 +0200",
        "Message-Id": "<1559317022-28779-3-git-send-email-david.marchand@redhat.com>",
        "In-Reply-To": "<1559317022-28779-1-git-send-email-david.marchand@redhat.com>",
        "References": "<20190408182510.16078-1-stephen@networkplumber.org>\n\t<1559317022-28779-1-git-send-email-david.marchand@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]); Fri, 31 May 2019 15:37:15 +0000 (UTC)",
        "Subject": "[dpdk-dev] [PATCH v5 2/5] eal: add lcore accessors",
        "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": "From: Stephen Hemminger <stephen@networkplumber.org>\n\nThe fields of the internal EAL core configuration are currently\nlaid bare as part of the API. This is not good practice and limits\nfixing issues with layout and sizes.\n\nMake new accessor functions for the fields used by current drivers\nand examples.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/librte_eal/common/eal_common_lcore.c  | 33 +++++++++++++++++++++++\n lib/librte_eal/common/include/rte_lcore.h | 44 +++++++++++++++++++++----------\n lib/librte_eal/rte_eal_version.map        | 12 +++++++++\n 3 files changed, 75 insertions(+), 14 deletions(-)\n\n---\nChangelog since v4:\n- marked rte_lcore_to_cpu_id and rte_lcore_cpuset as experimental\n\nChangelog since v3:\n- updated title\n- rebased on master\n- removed doc update\n- removed unneeded rte_lcore_return_code",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 8c2744f..38af260 100644\n--- a/lib/librte_eal/common/eal_common_lcore.c\n+++ b/lib/librte_eal/common/eal_common_lcore.c\n@@ -16,6 +16,39 @@\n #include \"eal_private.h\"\n #include \"eal_thread.h\"\n \n+int rte_lcore_index(int lcore_id)\n+{\n+\tif (unlikely(lcore_id >= RTE_MAX_LCORE))\n+\t\treturn -1;\n+\n+\tif (lcore_id < 0)\n+\t\tlcore_id = (int)rte_lcore_id();\n+\n+\treturn lcore_config[lcore_id].core_index;\n+}\n+\n+int rte_lcore_to_cpu_id(int lcore_id)\n+{\n+\tif (unlikely(lcore_id >= RTE_MAX_LCORE))\n+\t\treturn -1;\n+\n+\tif (lcore_id < 0)\n+\t\tlcore_id = (int)rte_lcore_id();\n+\n+\treturn lcore_config[lcore_id].core_id;\n+}\n+\n+rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)\n+{\n+\treturn lcore_config[lcore_id].cpuset;\n+}\n+\n+unsigned int\n+rte_lcore_to_socket_id(unsigned int lcore_id)\n+{\n+\treturn lcore_config[lcore_id].socket_id;\n+}\n+\n static int\n socket_id_cmp(const void *a, const void *b)\n {\ndiff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h\nindex 705594a..1e3c887 100644\n--- a/lib/librte_eal/common/include/rte_lcore.h\n+++ b/lib/librte_eal/common/include/rte_lcore.h\n@@ -121,15 +121,7 @@ struct lcore_config {\n  * @return\n  *   The relative index, or -1 if not enabled.\n  */\n-static inline int\n-rte_lcore_index(int lcore_id)\n-{\n-\tif (lcore_id >= RTE_MAX_LCORE)\n-\t\treturn -1;\n-\tif (lcore_id < 0)\n-\t\tlcore_id = (int)rte_lcore_id();\n-\treturn lcore_config[lcore_id].core_index;\n-}\n+int rte_lcore_index(int lcore_id);\n \n /**\n  * Return the ID of the physical socket of the logical core we are\n@@ -177,11 +169,35 @@ struct lcore_config {\n  * @return\n  *   the ID of lcoreid's physical socket\n  */\n-static inline unsigned int\n-rte_lcore_to_socket_id(unsigned int lcore_id)\n-{\n-\treturn lcore_config[lcore_id].socket_id;\n-}\n+unsigned int\n+rte_lcore_to_socket_id(unsigned int lcore_id);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Return the id of the lcore on a socket starting from zero.\n+ *\n+ * @param lcore_id\n+ *   The targeted lcore, or -1 for the current one.\n+ * @return\n+ *   The relative index, or -1 if not enabled.\n+ */\n+__rte_experimental int\n+rte_lcore_to_cpu_id(int lcore_id);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Return the cpuset for a given lcore.\n+ * @param lcore_id\n+ *   the targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1.\n+ * @return\n+ *   The cpuset of that lcore\n+ */\n+__rte_experimental rte_cpuset_t\n+rte_lcore_cpuset(unsigned int lcore_id);\n \n /**\n  * Test if an lcore is enabled.\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 2454934..824edf0 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -287,6 +287,14 @@ DPDK_19.05 {\n \n } DPDK_18.11;\n \n+DPDK_19.08 {\n+\tglobal:\n+\n+\trte_lcore_index;\n+\trte_lcore_to_socket_id;\n+\n+} DPDK_19.05;\n+\n EXPERIMENTAL {\n \tglobal:\n \n@@ -378,4 +386,8 @@ EXPERIMENTAL {\n \trte_service_lcore_attr_get;\n \trte_service_lcore_attr_reset_all;\n \trte_service_may_be_active;\n+\n+\t# added in 19.08\n+\trte_lcore_cpuset;\n+\trte_lcore_to_cpu_id;\n };\n",
    "prefixes": [
        "v5",
        "2/5"
    ]
}