get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1458,
    "url": "https://patches.dpdk.org/api/patches/1458/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-10-git-send-email-thomas.monjalon@6wind.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1416692622-28886-10-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1416692622-28886-10-git-send-email-thomas.monjalon@6wind.com",
    "date": "2014-11-22T21:43:41",
    "name": "[dpdk-dev,09/10] eal: get relative core index",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f4c24c02f235d92888bf65f92266d7c958b14144",
    "submitter": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-10-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1458/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1458/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 354FC7FEA;\n\tSat, 22 Nov 2014 22:33:56 +0100 (CET)",
            "from mail-wi0-f173.google.com (mail-wi0-f173.google.com\n\t[209.85.212.173]) by dpdk.org (Postfix) with ESMTP id CAF1B7FAD\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 22:33:50 +0100 (CET)",
            "by mail-wi0-f173.google.com with SMTP id r20so2413464wiv.0\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 13:44:31 -0800 (PST)",
            "from localhost.localdomain (136-92-190-109.dsl.ovh.fr.\n\t[109.190.92.136]) by mx.google.com with ESMTPSA id\n\tcz3sm13724087wjb.23.2014.11.22.13.44.29 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 22 Nov 2014 13:44:30 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=h0xTgvMWmPUBsE90R7IWEs4WcEalmcjiHw/8ccDoOB0=;\n\tb=JswkkPFTBRpt+lXtAL6Ws4OKU5Qqdgl5Mf7W4F97UERZoAnHuEULsLXWh5TBzshzm3\n\t979+XUIldr0bzkapeFeSL/6e3bOG8ODfPCa9vgKjSzRxA6Ata3OODvWhi8MwaTEbtQMI\n\tz0+kquHFP86j4auVoF9aYPUAY8+x1XvXf3FbfYGXNtNCOhhZ001cFOZAHI0g/uxWFoGt\n\tB/XHXrNuBxS1Tstc60Vt1/bHnRmunVgMQ+TIbbs1by/gIRl/IBCy5Kv/oywaCqIX2Xg+\n\tmsIrTPdxdr7xMQLeYsUzE+AZIz/mTBgTY+m7R4Q6Fbgl7IdMJci5e2VpWQ1fD7Qen3ek\n\tB02w==",
        "X-Gm-Message-State": "ALoCoQlFflyjWEbKEsqLLvCPBOdQFmZ0zebu25+h+Xue5zRYKDEA8RiR3UxBWeYGT6C3d+pwEdya",
        "X-Received": "by 10.194.119.230 with SMTP id kx6mr20591657wjb.80.1416692671387;\n\tSat, 22 Nov 2014 13:44:31 -0800 (PST)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 22 Nov 2014 22:43:41 +0100",
        "Message-Id": "<1416692622-28886-10-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.1.3",
        "In-Reply-To": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 09/10] eal: get relative core index",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/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: Patrick Lu <Patrick.Lu@intel.com>\n\nEAL -c option allows the user to enable any lcore in the system.\nOften times, the user app wants to know 1st enabled core, 2nd\nenabled core, etc, rather than phyical core ID (rte_lcore_id().)\n\nThe new API rte_lcore_index() will return an index from enabled lcores\nstarting from zero.\n\nSigned-off-by: Patrick Lu <patrick.lu@intel.com>\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n lib/librte_eal/common/eal_common_options.c | 13 ++++++++++---\n lib/librte_eal/common/include/rte_lcore.h  | 20 ++++++++++++++++++++\n 2 files changed, 30 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 18d03e3..c9df8f5 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -185,19 +185,23 @@ eal_parse_coremask(const char *coremask)\n \t\t\t\t\treturn -1;\n \t\t\t\t}\n \t\t\t\tcfg->lcore_role[idx] = ROLE_RTE;\n+\t\t\t\tlcore_config[idx].core_index = count;\n \t\t\t\tif (count == 0)\n \t\t\t\t\tcfg->master_lcore = idx;\n \t\t\t\tcount++;\n \t\t\t} else {\n \t\t\t\tcfg->lcore_role[idx] = ROLE_OFF;\n+\t\t\t\tlcore_config[idx].core_index = -1;\n \t\t\t}\n \t\t}\n \t}\n \tfor (; i >= 0; i--)\n \t\tif (coremask[i] != '0')\n \t\t\treturn -1;\n-\tfor (; idx < RTE_MAX_LCORE; idx++)\n+\tfor (; idx < RTE_MAX_LCORE; idx++) {\n \t\tcfg->lcore_role[idx] = ROLE_OFF;\n+\t\tlcore_config[idx].core_index = -1;\n+\t}\n \tif (count == 0)\n \t\treturn -1;\n \t/* Update the count of enabled logical cores of the EAL configuration */\n@@ -225,9 +229,11 @@ eal_parse_corelist(const char *corelist)\n \twhile ((i > 0) && isblank(corelist[i - 1]))\n \t\ti--;\n \n-\t/* Reset core roles */\n-\tfor (idx = 0; idx < RTE_MAX_LCORE; idx++)\n+\t/* Reset config */\n+\tfor (idx = 0; idx < RTE_MAX_LCORE; idx++) {\n \t\tcfg->lcore_role[idx] = ROLE_OFF;\n+\t\tlcore_config[idx].core_index = -1;\n+\t}\n \n \t/* Get list of cores */\n \tmin = RTE_MAX_LCORE;\n@@ -250,6 +256,7 @@ eal_parse_corelist(const char *corelist)\n \t\t\t\tmin = idx;\n \t\t\tfor (idx = min; idx <= max; idx++) {\n \t\t\t\tcfg->lcore_role[idx] = ROLE_RTE;\n+\t\t\t\tlcore_config[idx].core_index = count;\n \t\t\t\tif (count == 0)\n \t\t\t\t\tcfg->master_lcore = idx;\n \t\t\t\tcount++;\ndiff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h\nindex a0b4356..49b2c03 100644\n--- a/lib/librte_eal/common/include/rte_lcore.h\n+++ b/lib/librte_eal/common/include/rte_lcore.h\n@@ -64,6 +64,7 @@ struct lcore_config {\n \tvolatile enum rte_lcore_state_t state; /**< lcore state */\n \tunsigned socket_id;        /**< physical socket id for this lcore */\n \tunsigned core_id;          /**< core number on socket for this lcore */\n+\tint core_index;            /**< relative index, starting from 0 */\n };\n \n /**\n@@ -110,6 +111,25 @@ rte_lcore_count(void)\n }\n \n /**\n+ * Return the index of the lcore starting from zero.\n+ * The order is physical or given by command line (-l option).\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+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 = rte_lcore_id();\n+\treturn lcore_config[lcore_id].core_index;\n+}\n+\n+/**\n  * Return the ID of the physical socket of the logical core we are\n  * running on.\n  * @return\n",
    "prefixes": [
        "dpdk-dev",
        "09/10"
    ]
}