Show a patch.

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

{
    "id": 44560,
    "url": "http://patches.dpdk.org/api/patches/44560/",
    "web_url": "http://patches.dpdk.org/patch/44560/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180911080216.3017-5-mattias.ronnblom@ericsson.com>",
    "date": "2018-09-11T08:02:10",
    "name": "[v3,04/10] event/dsw: add support in DSW for linking/unlinking ports",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e57273f2ddddef323035ec088963260a38a0067a",
    "submitter": {
        "id": 1077,
        "url": "http://patches.dpdk.org/api/people/1077/",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerin.jacob@caviumnetworks.com"
    },
    "mbox": "http://patches.dpdk.org/patch/44560/mbox/",
    "series": [
        {
            "id": 1264,
            "url": "http://patches.dpdk.org/api/series/1264/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1264",
            "date": "2018-09-11T08:02:07",
            "name": "A Distributed Software Event Device",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1264/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44560/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44560/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.17.1",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Tue, 11 Sep 2018 10:02:10 +0200",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "bruce.richardson@intel.com, dev@dpdk.org, =?utf-8?q?Mattias_R=C3=B6nnb?=\n\t=?utf-8?q?lom?= <mattias.ronnblom@ericsson.com>",
        "To": "jerin.jacob@caviumnetworks.com",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180911080216.3017-1-mattias.ronnblom@ericsson.com>",
        "X-Spam-Status": "No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL\n\tautolearn=disabled version=3.4.1",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 43563532C;\n\tTue, 11 Sep 2018 10:03:22 +0200 (CEST)",
            "from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])\n\tby dpdk.org (Postfix) with ESMTP id 7E60B4C92\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 10:03:14 +0200 (CEST)",
            "from mail.lysator.liu.se (localhost [127.0.0.1])\n\tby mail.lysator.liu.se (Postfix) with ESMTP id 3148E4008E\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 10:03:14 +0200 (CEST)",
            "by mail.lysator.liu.se (Postfix, from userid 1004)\n\tid 2865A40086; Tue, 11 Sep 2018 10:03:14 +0200 (CEST)",
            "from isengard.friendlyfire.se\n\t(host-90-232-156-190.mobileonline.telia.com [90.232.156.190])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.lysator.liu.se (Postfix) with ESMTPSA id A194940020;\n\tTue, 11 Sep 2018 10:03:11 +0200 (CEST)"
        ],
        "Content-Type": "text/plain; charset=UTF-8",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Spam-Level": "",
        "Subject": "[dpdk-dev] [PATCH v3 04/10] event/dsw: add support in DSW for\n\tlinking/unlinking ports",
        "In-Reply-To": "<20180911080216.3017-1-mattias.ronnblom@ericsson.com>",
        "MIME-Version": "1.0",
        "Message-Id": "<20180911080216.3017-5-mattias.ronnblom@ericsson.com>",
        "X-Spam-Score": "-0.9",
        "Precedence": "list",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Spam-Checker-Version": "SpamAssassin 3.4.1 (2015-04-28) on\n\tbernadotte.lysator.liu.se",
        "X-Original-To": "patchwork@dpdk.org"
    },
    "content": "Added support for linking and unlinking ports to queues in a DSW event\ndevice.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n drivers/event/dsw/dsw_evdev.c | 67 +++++++++++++++++++++++++++++++++++\n drivers/event/dsw/dsw_evdev.h |  1 +\n 2 files changed, 68 insertions(+)",
    "diff": "diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c\nindex 91b1a2449..5dccc232a 100644\n--- a/drivers/event/dsw/dsw_evdev.c\n+++ b/drivers/event/dsw/dsw_evdev.c\n@@ -2,6 +2,8 @@\n  * Copyright(c) 2018 Ericsson AB\n  */\n \n+#include <stdbool.h>\n+\n #include <rte_eventdev_pmd.h>\n #include <rte_eventdev_pmd_vdev.h>\n \n@@ -112,6 +114,69 @@ dsw_queue_release(struct rte_eventdev *dev __rte_unused,\n {\n }\n \n+static void\n+queue_add_port(struct dsw_queue *queue, uint16_t port_id)\n+{\n+\tqueue->serving_ports[queue->num_serving_ports] = port_id;\n+\tqueue->num_serving_ports++;\n+}\n+\n+static bool\n+queue_remove_port(struct dsw_queue *queue, uint16_t port_id)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < queue->num_serving_ports; i++)\n+\t\tif (queue->serving_ports[i] == port_id) {\n+\t\t\tuint16_t last_idx = queue->num_serving_ports - 1;\n+\t\t\tif (i != last_idx)\n+\t\t\t\tqueue->serving_ports[i] =\n+\t\t\t\t\tqueue->serving_ports[last_idx];\n+\t\t\tqueue->num_serving_ports--;\n+\t\t\treturn true;\n+\t\t}\n+\treturn false;\n+}\n+\n+static int\n+dsw_port_link_unlink(struct rte_eventdev *dev, void *port,\n+\t\t     const uint8_t queues[], uint16_t num, bool link)\n+{\n+\tstruct dsw_evdev *dsw = dsw_pmd_priv(dev);\n+\tstruct dsw_port *p = port;\n+\tuint16_t i;\n+\tuint16_t count = 0;\n+\n+\tfor (i = 0; i < num; i++) {\n+\t\tuint8_t qid = queues[i];\n+\t\tstruct dsw_queue *q = &dsw->queues[qid];\n+\t\tif (link) {\n+\t\t\tqueue_add_port(q, p->id);\n+\t\t\tcount++;\n+\t\t} else {\n+\t\t\tbool removed = queue_remove_port(q, p->id);\n+\t\t\tif (removed)\n+\t\t\t\tcount++;\n+\t\t}\n+\t}\n+\n+\treturn count;\n+}\n+\n+static int\n+dsw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],\n+\t      const uint8_t priorities[] __rte_unused, uint16_t num)\n+{\n+\treturn dsw_port_link_unlink(dev, port, queues, num, true);\n+}\n+\n+static int\n+dsw_port_unlink(struct rte_eventdev *dev, void *port, uint8_t queues[],\n+\t\tuint16_t num)\n+{\n+\treturn dsw_port_link_unlink(dev, port, queues, num, false);\n+}\n+\n static void\n dsw_info_get(struct rte_eventdev *dev __rte_unused,\n \t     struct rte_event_dev_info *info)\n@@ -150,6 +215,8 @@ static struct rte_eventdev_ops dsw_evdev_ops = {\n \t.queue_setup = dsw_queue_setup,\n \t.queue_def_conf = dsw_queue_def_conf,\n \t.queue_release = dsw_queue_release,\n+\t.port_link = dsw_port_link,\n+\t.port_unlink = dsw_port_unlink,\n \t.dev_infos_get = dsw_info_get,\n \t.dev_configure = dsw_configure,\n };\ndiff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h\nindex 2a4f10421..ad0f857cc 100644\n--- a/drivers/event/dsw/dsw_evdev.h\n+++ b/drivers/event/dsw/dsw_evdev.h\n@@ -51,6 +51,7 @@ struct dsw_port {\n \n struct dsw_queue {\n \tuint8_t schedule_type;\n+\tuint8_t serving_ports[DSW_MAX_PORTS];\n \tuint16_t num_serving_ports;\n };\n \n",
    "prefixes": [
        "v3",
        "04/10"
    ]
}