get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52211,
    "url": "http://patches.dpdk.org/api/patches/52211/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190403171610.23970-2-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": "<20190403171610.23970-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190403171610.23970-2-stephen@networkplumber.org",
    "date": "2019-04-03T17:16:06",
    "name": "[RFC,1/5] eal: add accessor functions for lcore_config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7b4ae6f8f34e1ef735f3d358dd9617e4fcab04c5",
    "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/20190403171610.23970-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4095,
            "url": "http://patches.dpdk.org/api/series/4095/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4095",
            "date": "2019-04-03T17:16:05",
            "name": "make lcore_config less visible",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4095/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52211/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52211/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 7624E1B512;\n\tWed,  3 Apr 2019 19:16:23 +0200 (CEST)",
            "from mail-pg1-f171.google.com (mail-pg1-f171.google.com\n\t[209.85.215.171]) by dpdk.org (Postfix) with ESMTP id E68201B4ED\n\tfor <dev@dpdk.org>; Wed,  3 Apr 2019 19:16:17 +0200 (CEST)",
            "by mail-pg1-f171.google.com with SMTP id i2so8635427pgj.11\n\tfor <dev@dpdk.org>; Wed, 03 Apr 2019 10:16:17 -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\tk14sm23041693pfb.125.2019.04.03.10.16.15\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 03 Apr 2019 10:16:15 -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=4ATaw2+J2yf9RUkQAsCJwSsb3985TdCTdsjttjhqaDw=;\n\tb=Jw+taltUSgn+axPS+Ic1NcMlhuatEz9qf+g7L7+08TEMlmooUgPXJVLQiYew9pd314\n\twELoE/eFaJNHIxtB22oRwzabcNr60HL6A6iDIHhKAL5IpOb9Y6GlOWxYw6E0NGU6XOYH\n\t7kEWELdjua36u/c15uJm98kV9iF83b2CQlxoB6DYMlTMUNBNHYy4uZTFivtpRfZ+fPN8\n\t1Noe3Rrl71pL+LrvrE9EmA8+REYc1jl/zdPQzycJGK+6YFUtGTA3uuH3g8aM94datXIe\n\teIzrq+DFMkP6PrUn2BE3UyaywsQ2XXx1GCJZ7/hcRMw6D++tnluRj/jcHi7zAhVGOcrz\n\tl0rw==",
        "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=4ATaw2+J2yf9RUkQAsCJwSsb3985TdCTdsjttjhqaDw=;\n\tb=o0GI2ZJ20YHC5Z1GnX0370/gM5YK5fU81tgqTr0t+DH554gbxehTugkBmaf0s+6QuM\n\tz5vI9ufQlzKAHEqmtsnGECL+ljc8yon2ZhwR50xfUcojYihcSn8NpfMOWAgr8BEWOs+r\n\th92iWrruatcjUMz1iMvFVnt8mcUVt8+puMC/Ou+X7OFkydd/+BBzGwXRR+WU6vYW/hCJ\n\t/7eaTF+o12jIS1Vdz4WdRC+apqfB/v/BFLlTNBomjCY4Q/uTgPVlq34k6/2r23IQNMox\n\t17tj2g2Kj/XkUauWAXik6ZxNzhJ/12GTbkijCmIQ4CnOGTChDkAEITA/n/rGxsCnp3Kw\n\t5tdQ==",
        "X-Gm-Message-State": "APjAAAX7UpDOJhM01sMx3zhmoU2kyY80bCCWFeVNJW/uiPVi7eV7Iw//\n\tm3PuGXHFOcxJlp2uAC8a3flx+HGoKnFCcw==",
        "X-Google-Smtp-Source": "APXvYqyRvhiMqzrpfjbnJnmbP6QGpNXfpyWP1fS0T1jDpoLqJebKckpUjvRqLuSCtUWLhWqNTx0/vw==",
        "X-Received": "by 2002:a63:ff26:: with SMTP id k38mr802205pgi.123.1554311776453;\n\tWed, 03 Apr 2019 10:16:16 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Wed,  3 Apr 2019 10:16:06 -0700",
        "Message-Id": "<20190403171610.23970-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190403171610.23970-1-stephen@networkplumber.org>",
        "References": "<20190403171610.23970-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [RFC 1/5] eal: add accessor functions for lcore_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 the state and return code functions as experimental\nsince these values 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>\n---\n doc/guides/rel_notes/release_19_05.rst    |  7 +++\n lib/librte_eal/common/eal_common_lcore.c  | 46 ++++++++++++++++++\n lib/librte_eal/common/include/rte_lcore.h | 57 +++++++++++++++++------\n 3 files changed, 96 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 bdad1ddbeedf..995fbf177b93 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -188,6 +188,13 @@ 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 \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..806204d9f73d 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,52 @@\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 lcore_id)\n+{\n+\treturn lcore_config[lcore_id].cpuset;\n+}\n+\n+unsigned\n+rte_lcore_to_socket_id(unsigned int lcore_id)\n+{\n+\treturn lcore_config[lcore_id].socket_id;\n+}\n+\n+enum rte_lcore_state_t\n+rte_lcore_state(unsigned lcore_id)\n+{\n+\treturn lcore_config[lcore_id].state;\n+}\n+\n+int\n+rte_lcore_return_code(unsigned lcore_id)\n+{\n+\treturn lcore_config[lcore_id].ret;\n+}\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 dea17f500065..7477ed2d9550 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 @@ 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_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,37 @@ rte_socket_id_by_idx(unsigned int idx);\n  * @return\n  *   the ID of lcoreid's physical socket\n  */\n-static inline unsigned\n-rte_lcore_to_socket_id(unsigned lcore_id)\n-{\n-\treturn lcore_config[lcore_id].socket_id;\n-}\n+unsigned rte_lcore_to_socket_id(unsigned 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 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 rte_lcore_cpuset(unsigned 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 lcore_id);\n \n /**\n  * Test if an lcore is enabled.\n@@ -201,6 +219,17 @@ rte_lcore_is_enabled(unsigned lcore_id)\n \treturn cfg->lcore_role[lcore_id] == ROLE_RTE;\n }\n \n+/**\n+ * Get the state of an lcore ID.\n+ *\n+ * @param lcore_id\n+ *   the targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1.\n+ * @return\n+ *   the current state of that lcore\n+ */\n+enum rte_lcore_state_t __rte_experimental\n+rte_lcore_state(unsigned lcore_id);\n+\n /**\n  * Get the next enabled lcore ID.\n  *\n",
    "prefixes": [
        "RFC",
        "1/5"
    ]
}