get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54254,
    "url": "http://patches.dpdk.org/api/patches/54254/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-31-git-send-email-anoobj@marvell.com/",
    "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": "<1559583160-13944-31-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559583160-13944-31-git-send-email-anoobj@marvell.com",
    "date": "2019-06-03T17:32:30",
    "name": "[30/39] eventdev: add routine to access eventmode link info",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "a8b702a346334cb4937adba541c2ad63679bb10c",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-31-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 4868,
            "url": "http://patches.dpdk.org/api/series/4868/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4868",
            "date": "2019-06-03T17:32:00",
            "name": "adding eventmode helper library",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4868/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54254/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54254/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 8A1431BBEF;\n\tMon,  3 Jun 2019 19:36:29 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 3EDFD1BBED\n\tfor <dev@dpdk.org>; Mon,  3 Jun 2019 19:36:28 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx53HKadB027621; Mon, 3 Jun 2019 10:36:27 -0700",
            "from sc-exch04.marvell.com ([199.233.58.184])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr73r-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 03 Jun 2019 10:36:27 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com\n\t(10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 3 Jun 2019 10:36:24 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 3 Jun 2019 10:36:24 -0700",
            "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56])\n\tby maili.marvell.com (Postfix) with ESMTP id 546F93F703F;\n\tMon,  3 Jun 2019 10:36:20 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=glHs6hF4Z4KL+D3/czNJ339orN7pX3dGuzehRREBckw=;\n\tb=DeJOhF2k1ZAxl+p3spwS/JV0sVJvDJ9+H5xLixQL4hFm661vTGestXLm4rTr1nk7fFu7\n\t5EuKvXL7yhNwCjITIngwT4rbjduaTVJwqBvZ3Apxmj333z6ezvQM8XFueJXiwHcSkwEZ\n\tWystRWfq0m2m3XmziD9HVVkOW5ccdtQOL1d7X06QC4ubFr38wPmgLJEvae+H1BCuj9D5\n\t38rp4iNbh5t1PlLUqsnV+ujvRaSpymvEkSwXrQ3Q1p7PQML5Lq2SMjkEmoEUh72IeYNj\n\tyr1CZw2E/xfZcN0otJ+T5TuFx/dz8V/4Dy++MqVVznXz7fZG9b2qsaMWzqvbO2k3eRJw\n\tbg== ",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Nikhil Rao <nikhil.rao@intel.com>,\n\t\"Erik Gabriel Carrillo\" <erik.g.carrillo@intel.com>, Abhinandan Gujjar\n\t<abhinandan.gujjar@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Narayana Prasad <pathreya@marvell.com>,\n\t<dev@dpdk.org>, Lukasz Bartosik <lbartosik@marvell.com>, Pavan Nikhilesh\n\t<pbhagavatula@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n\t\"Nipun  Gupta\" <nipun.gupta@nxp.com>, Harry van Haaren\n\t<harry.van.haaren@intel.com>, =?utf-8?q?Mattias_R=C3=B6nnblom?=\n\t<mattias.ronnblom@ericsson.com>,  Liang Ma <liang.j.ma@intel.com>",
        "Date": "Mon, 3 Jun 2019 23:02:30 +0530",
        "Message-ID": "<1559583160-13944-31-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "References": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-03_13:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH 30/39] eventdev: add routine to access eventmode\n\tlink info",
        "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": "When the application is drafted for single stage eventmode, it will be\nefficient to have the loop in the application space, rather than passing\nit on to the helper. But application would need to have info on the\nlinks to be able to do that efficiently. This function exposes the links\nto that application.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n lib/librte_eventdev/rte_eventdev_version.map |  1 +\n lib/librte_eventdev/rte_eventmode_helper.c   | 80 ++++++++++++++++++++++++++++\n lib/librte_eventdev/rte_eventmode_helper.h   | 24 +++++++++\n 3 files changed, 105 insertions(+)",
    "diff": "diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map\nindex 8b78a68..8137cb5 100644\n--- a/lib/librte_eventdev/rte_eventdev_version.map\n+++ b/lib/librte_eventdev/rte_eventdev_version.map\n@@ -133,4 +133,5 @@ EXPERIMENTAL {\n \trte_eventmode_helper_parse_args;\n \trte_eventmode_helper_initialize_devs;\n \trte_eventmode_helper_display_conf;\n+\trte_eventmode_helper_get_event_lcore_links;\n };\ndiff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c\nindex a333c4a..6c853f6 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper.c\n+++ b/lib/librte_eventdev/rte_eventmode_helper.c\n@@ -847,3 +847,83 @@ rte_eventmode_helper_initialize_devs(\n \n \treturn 0;\n }\n+\n+/* Helper functions for eventmode workers */\n+\n+uint8_t __rte_experimental\n+rte_eventmode_helper_get_event_lcore_links(uint32_t lcore_id,\n+\t\tstruct rte_eventmode_helper_conf *mode_conf,\n+\t\tstruct rte_eventmode_helper_event_link_info **links)\n+{\n+\tint i;\n+\tint index = 0;\n+\tuint8_t lcore_nb_link = 0;\n+\tstruct rte_eventmode_helper_event_link_info *link;\n+\tstruct rte_eventmode_helper_event_link_info *link_cache;\n+\tstruct eventmode_conf *em_conf = NULL;\n+\tsize_t cache_size;\n+\tsize_t single_link_size;\n+\n+\tif (mode_conf == NULL || links == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Invalid args\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* Get eventmode conf */\n+\tem_conf = (struct eventmode_conf *)(mode_conf->mode_params);\n+\n+\tif (em_conf == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Invalid event mode conf\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* Get the number of links registered */\n+\tfor (i = 0; i < em_conf->nb_link; i++) {\n+\n+\t\t/* Get link */\n+\t\tlink = &(em_conf->link[i]);\n+\n+\t\t/* Check if we have link intended for this lcore */\n+\t\tif (link->lcore_id == lcore_id) {\n+\n+\t\t\t/* Update the number of links for this core */\n+\t\t\tlcore_nb_link++;\n+\n+\t\t}\n+\t}\n+\n+\t/* Compute size of one entry to be copied */\n+\tsingle_link_size = sizeof(struct rte_eventmode_helper_event_link_info);\n+\n+\t/* Compute size of the buffer required */\n+\tcache_size = lcore_nb_link *\n+\t\t\tsizeof(struct rte_eventmode_helper_event_link_info);\n+\n+\t/* Allocate memory for caching the links */\n+\tlink_cache = rte_zmalloc(\"eventmode-event-lcore-links\", cache_size,\n+\t\t\tRTE_CACHE_LINE_SIZE);\n+\n+\t/* Get the number of links registered */\n+\tfor (i = 0; i < em_conf->nb_link; i++) {\n+\n+\t\t/* Get link */\n+\t\tlink = &(em_conf->link[i]);\n+\n+\t\t/* Check if we have link intended for this lcore */\n+\t\tif (link->lcore_id == lcore_id) {\n+\n+\t\t\t/* Cache the link */\n+\t\t\tmemcpy(&link_cache[index], link, single_link_size);\n+\n+\t\t\t/* Update index */\n+\t\t\tindex++;\n+\t\t}\n+\t}\n+\n+\t/* Update the links for application to use the cached links */\n+\t*links = link_cache;\n+\n+\t/* Return the number of cached links */\n+\treturn lcore_nb_link;\n+}\n+\ndiff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h\nindex d4941be..925b660 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper.h\n+++ b/lib/librte_eventdev/rte_eventmode_helper.h\n@@ -112,6 +112,30 @@ rte_eventmode_helper_initialize_devs(\n void __rte_experimental\n rte_eventmode_helper_display_conf(struct rte_eventmode_helper_conf *mode_conf);\n \n+/**\n+ * Get event dev - lcore links\n+ *\n+ * Since the execution loop is in the application, the application would need\n+ * the info on which event port to be polled by an lcore etc. This helper\n+ * function would help the application in doing so. The 'links' would point\n+ * to the memory allocated for the links list, and the application should\n+ * release this, once the use is over.\n+ *\n+ * @param lcore_id\n+ *   ID of the lcore for which the links list need to be populated\n+ * @param mode_conf\n+ *   Configuration of the mode in which app is doing packet handling\n+ * @param links\n+ *   Used to pass the pointer of the memory allocated by the helper to the\n+ *   application\n+ * @return\n+ *   Number of links found for the lcore\n+ */\n+uint8_t __rte_experimental\n+rte_eventmode_helper_get_event_lcore_links(uint32_t lcore_id,\n+\t\tstruct rte_eventmode_helper_conf *mode_conf,\n+\t\tstruct rte_eventmode_helper_event_link_info **links);\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "30/39"
    ]
}