get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53264,
    "url": "http://patches.dpdk.org/api/patches/53264/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190503172507.5272-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": "<20190503172507.5272-3-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190503172507.5272-3-stephen@networkplumber.org",
    "date": "2019-05-03T17:25:04",
    "name": "[v3,2/5] eal: add accessor functions for lcore_config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4ee746b32f6f504fa097d62a6a2956d1186cae16",
    "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/20190503172507.5272-3-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4560,
            "url": "http://patches.dpdk.org/api/series/4560/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4560",
            "date": "2019-05-03T17:25:02",
            "name": "prepare to make lcore_config not visible in ABI",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4560/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53264/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/53264/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 6B29F1B11A;\n\tFri,  3 May 2019 19:25:22 +0200 (CEST)",
            "from mail-pg1-f181.google.com (mail-pg1-f181.google.com\n\t[209.85.215.181]) by dpdk.org (Postfix) with ESMTP id 16DAC1B107\n\tfor <dev@dpdk.org>; Fri,  3 May 2019 19:25:19 +0200 (CEST)",
            "by mail-pg1-f181.google.com with SMTP id j26so3032445pgl.5\n\tfor <dev@dpdk.org>; Fri, 03 May 2019 10:25:19 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tt13sm3109578pgj.49.2019.05.03.10.25.16\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 03 May 2019 10:25:16 -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\t:mime-version:content-transfer-encoding;\n\tbh=gsT8g95CdCyxJl6epoAfw3UyifKXpWKn2cCa/f9AIzQ=;\n\tb=Hl73ZHp6o8zVVOVW26LhVLgo9DHbZc+f8AFaerpLltycSb18EF5X8Zfu4XuRP61dfr\n\tI1vsDxKKB9z1RDb3cGs+etEy3TlvB3cjmjGfXbkaJGQ8JboA/6EsorA1DwSUNACp5HCG\n\tA+p73nVEWDJ4XQzUKbIgfLT+DhAx9uU+ZzxhYfOFoIXAKNxntl0KHADzIP5oArGqa1QT\n\t3dpspj8IdUQ1OGUnf+zJ61j1Xi9SJaceih26XZG6b45f4Bz9VOamyUlK/EttHDM4gy+7\n\tJinQc3/AI0llC8JB4J1B8L+R6Kbd970eDfVFBFMdk8GngQ1wUJTGrUUP60CdkeHqTg9I\n\tQf1A==",
        "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:mime-version:content-transfer-encoding;\n\tbh=gsT8g95CdCyxJl6epoAfw3UyifKXpWKn2cCa/f9AIzQ=;\n\tb=rS1rMGk+MVAAjeiR2xhkzxTKHz34FU4Y90bB+02PcMcPBfY+0AvlUqOVoV5rdCCUd5\n\tzhz6zKdhbOKC2jGRluOO4n6ksrSLrkIl6NGtwj1pC4S6RRrC9AQK8fHIstUuh6cwnDU0\n\trLb1QuJHN3iYmVoOTHLfI8z7Cq2k9hL8MUIyMNF6Ps6Yl68BYVE8ALHTRm5pRlaBuXhn\n\t4uYBHrye4bE41P5taxedkEKLPLWcMbNwm7Zb2/E2W5dZbwVzpN8rh3h0h3pYCj5MoPgB\n\tC7gau3vd2eZ3O94aqP9yIBVsLphGWasczo+BWllM9hLsF0IUfwgJFuEBH5yA/QX95a39\n\tkHEg==",
        "X-Gm-Message-State": "APjAAAXmq33b1fqtRNSaZqDRY/2xcgKwWzS1FdLpPWVc1kdsN+CrGoXU\n\tP7F900aKqJduEENEQ+/xlsZtZ72oS4k=",
        "X-Google-Smtp-Source": "APXvYqydQ8QQAW+bqVCvDtM2h/NESHN3FXruqG4vYpxqPQVZ21teAsiPuXz1LQC9vYZ5SfxuguZQkw==",
        "X-Received": "by 2002:a63:d408:: with SMTP id\n\ta8mr11646702pgh.184.1556904318062; \n\tFri, 03 May 2019 10:25:18 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tDavid Marchand <david.marchand@redhat.com>",
        "Date": "Fri,  3 May 2019 10:25:04 -0700",
        "Message-Id": "<20190503172507.5272-3-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190503172507.5272-1-stephen@networkplumber.org>",
        "References": "<20190410171603.8979-1-stephen@networkplumber.org>\n\t<20190503172507.5272-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 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 | 49 ++++++++++++++++-------\n lib/librte_eal/rte_eal_version.map        | 11 +++++\n 4 files changed, 91 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 468e325395c7..35c0c9081958 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -275,6 +275,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 8c2744fabcbf..ae59c98ca43a 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 705594acbb5e..d0006a077fae 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,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 245493461c36..b4aec1667122 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -287,6 +287,16 @@ DPDK_19.05 {\n \n } DPDK_18.11;\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.11;\n+\n EXPERIMENTAL {\n \tglobal:\n \n@@ -337,6 +347,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": [
        "v3",
        "2/5"
    ]
}