get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52611,
    "url": "http://patches.dpdk.org/api/patches/52611/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190410171603.8979-3-stephen@networkplumber.org/",
    "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": "<20190410171603.8979-3-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190410171603.8979-3-stephen@networkplumber.org",
    "date": "2019-04-10T17:16:00",
    "name": "[v2,2/5] eal: add accessor functions for lcore_config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "455e24d5e9ec0e590e3395bce28031d92454690d",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20190410171603.8979-3-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4248,
            "url": "http://patches.dpdk.org/api/series/4248/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4248",
            "date": "2019-04-10T17:15:58",
            "name": "make lcore_config internal",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4248/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52611/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52611/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 425AA1B273;\n\tWed, 10 Apr 2019 19:16:17 +0200 (CEST)",
            "from mail-pf1-f169.google.com (mail-pf1-f169.google.com\n\t[209.85.210.169]) by dpdk.org (Postfix) with ESMTP id E70501B1EB\n\tfor <dev@dpdk.org>; Wed, 10 Apr 2019 19:16:10 +0200 (CEST)",
            "by mail-pf1-f169.google.com with SMTP id c207so1864229pfc.7\n\tfor <dev@dpdk.org>; Wed, 10 Apr 2019 10:16:10 -0700 (PDT)",
            "from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com.\n\t[204.195.22.127]) by smtp.gmail.com with ESMTPSA id\n\td25sm48995244pfn.154.2019.04.10.10.16.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 10 Apr 2019 10:16:08 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=a8uXyu9PL+of0FN4+Hrv0EduEbX9asmVh/GVzdm8SWM=;\n\tb=MYgRcGIM0qLeJmEaEhE9HXAkBc+MpyqPe8VH60MBGOGW4+nCoMYxiRt5dlcaeENr7Z\n\tIEce1R9seqO+txvNdgyNu46uNghtwCvakXkQwfM/0pxSxhMUMd9MI+kbvf58ITysGyG1\n\tpK1PwvPQvmvGetnjcryYPnQcz1rhEksid2qm3Y7IasJM5NByNsdM9uhqmypkvIKWgTMW\n\tcspCGX3rhE3RvZoLXZazYgVlfJf2sGR03+oJBB9fHQW3JjlYvF3zG0pluY3KNWFb42os\n\tw2ugp32OHlyYI6XKMjSBlMsuOHgjhbBOn3D/tm3D9e+oTOPgtCWVFJslgiLSiDkeBPx0\n\tk+dg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=a8uXyu9PL+of0FN4+Hrv0EduEbX9asmVh/GVzdm8SWM=;\n\tb=ljK63eXzrhbwe/jPbMhhmuxR4UgKxVbW6pzHYK4MEfe3effwrKxx4pi8111+rEZwoy\n\tonim4h6fQ4v4UNnWH2K/86wLJbNkCOYjZtT2v/9liSWWvc6PN24+9vVBAfUHU13WNSu2\n\tYayQ87JJWtIAqfTGjUTw10TSCs2n/bfv9pOm+vMXUFbgkm2BPolR59C/OGzmAHv0EQ2/\n\tCjDiGAvELhOOlAXtf7xk8R7rMRLm4mu198oo/E2mPZT1+BMq92VDt9tEjPUmILmeaqUf\n\tM1J+bCygZg7D5i4u5aK3uYv/rLPVYSE5utVdaz/FyRe8r+K04lcOQ6yHyBF8rqvSeTY+\n\t5R6w==",
        "X-Gm-Message-State": "APjAAAVbNRIa0lLzM3YgeIVnPXL2NYTX0uJ56ApNqhCnTq0pd/6Nbgf4\n\t2Y8ZgdNeSkpK0QpwjQFPPAJATW/W7LE=",
        "X-Google-Smtp-Source": "APXvYqwckjIGtiNExdh8gYJjJ3ZvZTFyxvb6+QoSMAVKgYMF2Zna+EUqo7BqwJlZsq0iNQ0XsHI6fA==",
        "X-Received": "by 2002:a63:4847:: with SMTP id\n\tx7mr42538677pgk.233.1554916569576; \n\tWed, 10 Apr 2019 10:16:09 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Wed, 10 Apr 2019 10:16:00 -0700",
        "Message-Id": "<20190410171603.8979-3-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190410171603.8979-1-stephen@networkplumber.org>",
        "References": "<20190408182510.16078-1-stephen@networkplumber.org>\n\t<20190410171603.8979-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v2 2/5] eal: add accessor functions for\n\tlcore_config",
        "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": "The 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. Mark return code functions as experimental\nsince this value might change in the future and probably shouldn't\nhave been used by non EAL code anyway.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nReviewed-by: David Marchand <david.marchand@redhat.com>\n---\n doc/guides/rel_notes/release_19_05.rst    |  6 +++\n lib/librte_eal/common/eal_common_lcore.c  | 39 ++++++++++++++++++\n lib/librte_eal/common/include/rte_lcore.h | 50 ++++++++++++++++-------\n lib/librte_eal/rte_eal_version.map        | 11 +++++\n 4 files changed, 92 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst\nindex dbdf07a0c05b..32aae5d3bcfa 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -222,6 +222,12 @@ ABI Changes\n   alignment for ``rte_crypto_asym_op`` to restore expected ``rte_crypto_op``\n   layout and alignment.\n \n+* eal: the lcore config structure ``struct lcore_config`` will be made\n+  internal to the EAL in a future release. This will allow the structure to\n+  change without impacting API or ABI. All accesses to fields of this\n+  structure should be done by the corresponding accessor functions.\n+  For example, instead of using ``lcore_config[lcore_id].socket_id``\n+  the function ``rte_lcore_socket_id(lcore_id)`` should be used instead.\n \n Shared Library Versions\n -----------------------\ndiff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 1cbac42286ba..6cf4d7abb0bd 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,45 @@\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+int\n+rte_lcore_return_code(unsigned int lcore_id)\n+{\n+\treturn lcore_config[lcore_id].ret;\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 959ef9ece4b2..dc9f3dc0843d 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,8 @@ rte_lcore_count(void)\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_experimental\n+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 +170,40 @@ rte_socket_id_by_idx(unsigned int idx);\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+ * 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+int\n+rte_lcore_to_cpu_id(int lcore_id);\n+\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_cpuset_t\n+rte_lcore_cpuset(unsigned int lcore_id);\n+\n+/**\n+ * Get the return code from a lcore thread.\n+ * @param lcore_id\n+ *   the targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1\n+ *   and finished\n+ * @return\n+ *   the return code from the lcore thread\n+ */\n+int __rte_experimental\n+rte_lcore_return_code(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 d6e375135ad1..f6688327cad3 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -268,6 +268,16 @@ DPDK_18.11 {\n \n } DPDK_18.08;\n \n+DPDK_19.05 {\n+\tglobal:\n+\n+\trte_lcore_cpuset;\n+\trte_lcore_index;\n+\trte_lcore_to_cpu_id;\n+\trte_lcore_to_socket_id;\n+\n+} DPDK_18.08;\n+\n EXPERIMENTAL {\n \tglobal:\n \n@@ -329,6 +339,7 @@ EXPERIMENTAL {\n \trte_fbarray_set_free;\n \trte_fbarray_set_used;\n \trte_intr_callback_unregister_pending;\n+\trte_lcore_return_code;\n \trte_log_register_type_and_pick_level;\n \trte_malloc_dump_heaps;\n \trte_malloc_heap_create;\n",
    "prefixes": [
        "v2",
        "2/5"
    ]
}