get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52441,
    "url": "http://patches.dpdk.org/api/patches/52441/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190408182510.16078-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": "<20190408182510.16078-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190408182510.16078-2-stephen@networkplumber.org",
    "date": "2019-04-08T18:25:06",
    "name": "[v1,1/5] eal: add accessor functions for lcore_config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a091f0f2027f2af7bc3c6cfbc91f1c04ce1da509",
    "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/20190408182510.16078-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4190,
            "url": "http://patches.dpdk.org/api/series/4190/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4190",
            "date": "2019-04-08T18:25:05",
            "name": "make lcore_config internal",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4190/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52441/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52441/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 C953B5592;\n\tMon,  8 Apr 2019 20:25:19 +0200 (CEST)",
            "from mail-pl1-f181.google.com (mail-pl1-f181.google.com\n\t[209.85.214.181]) by dpdk.org (Postfix) with ESMTP id 7209D3572\n\tfor <dev@dpdk.org>; Mon,  8 Apr 2019 20:25:16 +0200 (CEST)",
            "by mail-pl1-f181.google.com with SMTP id b3so7794871plr.7\n\tfor <dev@dpdk.org>; Mon, 08 Apr 2019 11:25:16 -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\td25sm40891081pfn.154.2019.04.08.11.25.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 08 Apr 2019 11:25:13 -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=mbQIcA1uhldaEFarsVAa047HrCNJQvNe3d0S2pgozUY=;\n\tb=KOIOmdS1192jR0taCOWOJG2ICxauJZfqzkX9NCokWEaqY6nY1Iissh6erQuuwcX+mc\n\tuNLiwzWNsAdD5XQnZaPA3aYn6Z3ToiH2bpxPrHqInDtNAAE/f82DWwk8tY0k3jC+tKFJ\n\tmI7DkRPL6pFRTNqGeKT292SKV1KxHFGakGD740pRFrRWgCxVWOVtDxbhiOJlVAgDCUmg\n\tDbyp5Nb6mjOLEBInYupmFcNbMl+O271803Th3GsUwidXaejbqV1gmWn1qB9WGXI9t+Tn\n\t658J+Yul4+8Q/HRrvymZ4kZmoi0VoGPcjMnjf7nLXshYeGZDz2+hjAPc6GoI8cnz4CuK\n\t18pg==",
        "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=mbQIcA1uhldaEFarsVAa047HrCNJQvNe3d0S2pgozUY=;\n\tb=gR1CYby6NoLVZTZO/LelHuBsDQid0d9n6nHithpo7mCzJLvgDCq/ln6GXt6cLBC75I\n\t9Jm+dwpz7Fi0GIZfJQWsFXUe3JHdP66FZg1TqqubGxi6HoGycNay45zah0r8+eN7d+nt\n\ty6PfOREyXLGXtVhAaC660xNTAYLd/XF40VlbrU/EaMA2wykniYxRTh+GUT2PTJh7vHIt\n\teAqoJCNsUcR1kRYAxQxb2c539JGZAg1EIVPpGET+hU23g2RDR796pQsHleXsz5BzJRgz\n\tczotkhANulhFG//8T34kRIUGNXtNCsfKc/+GMKQqmWimlmtR/cp71j7z2bQcJjJo7gGf\n\teMgw==",
        "X-Gm-Message-State": "APjAAAXEZCMd7H7FUu4B8acuRAZC5gt+V8JRQ6lb0jgS0DC/5vxcHQvm\n\tjUsADUD5nBQixbMe5L7Zuym8Bn7dMIWA8Q==",
        "X-Google-Smtp-Source": "APXvYqz6HWrA7K83qA8bKh8x6B8GDIzqmYvAKx/PXwHljt76GdKXJh6suHRnWfc9bU1f/56P7P8lBQ==",
        "X-Received": "by 2002:a17:902:f094:: with SMTP id\n\tgo20mr31697593plb.159.1554747914922; \n\tMon, 08 Apr 2019 11:25:14 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Mon,  8 Apr 2019 11:25:06 -0700",
        "Message-Id": "<20190408182510.16078-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190408182510.16078-1-stephen@networkplumber.org>",
        "References": "<20190408182510.16078-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v1 1/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 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\nMost of these functions are not marked as experimental since\nwe want applications to convert over asap. The one exception is\nthe return_code, which is only used by some tests now and not\nclear that it is even that useful.\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  | 39 +++++++++++++++++\n lib/librte_eal/common/include/rte_lcore.h | 52 ++++++++++++++++-------\n lib/librte_eal/rte_eal_version.map        | 11 +++++\n 4 files changed, 94 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst\nindex dbdf07a0c05b..4beea5705be7 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,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..c3cf5a06269d 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\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 dea17f500065..7687fe650f64 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\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\n-rte_lcore_to_socket_id(unsigned 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.\n@@ -193,7 +215,7 @@ rte_lcore_to_socket_id(unsigned lcore_id)\n  *   True if the given lcore is enabled; false otherwise.\n  */\n static inline int\n-rte_lcore_is_enabled(unsigned lcore_id)\n+rte_lcore_is_enabled(unsigned int lcore_id)\n {\n \tstruct rte_config *cfg = rte_eal_get_configuration();\n \tif (lcore_id >= RTE_MAX_LCORE)\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": [
        "v1",
        "1/5"
    ]
}