Show a patch.

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

{
    "id": 44559,
    "url": "http://patches.dpdk.org/api/patches/44559/",
    "web_url": "http://patches.dpdk.org/patch/44559/",
    "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-4-mattias.ronnblom@ericsson.com>",
    "date": "2018-09-11T08:02:09",
    "name": "[v3,03/10] event/dsw: add DSW port configuration",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "852a6d8f855e3b52a5387b911bbcf9a10cce29ff",
    "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/44559/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/44559/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44559/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "In-Reply-To": "<20180911080216.3017-1-mattias.ronnblom@ericsson.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.17.1",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 907274F91;\n\tTue, 11 Sep 2018 10:03:20 +0200 (CEST)",
            "from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])\n\tby dpdk.org (Postfix) with ESMTP id 37D4D4C92\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 E33F540087\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 10:03:13 +0200 (CEST)",
            "by mail.lysator.liu.se (Postfix, from userid 1004)\n\tid CD3664000F; Tue, 11 Sep 2018 10:03:13 +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 2C4EA4007C;\n\tTue, 11 Sep 2018 10:03:11 +0200 (CEST)"
        ],
        "References": "<20180911080216.3017-1-mattias.ronnblom@ericsson.com>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "MIME-Version": "1.0",
        "Message-Id": "<20180911080216.3017-4-mattias.ronnblom@ericsson.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Delivered-To": "patchwork@dpdk.org",
        "Content-Transfer-Encoding": "8bit",
        "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Content-Type": "text/plain; charset=UTF-8",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "jerin.jacob@caviumnetworks.com",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Spam-Status": "No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL\n\tautolearn=disabled version=3.4.1",
        "X-Spam-Level": "",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Spam-Checker-Version": "SpamAssassin 3.4.1 (2015-04-28) on\n\tbernadotte.lysator.liu.se",
        "X-BeenThere": "dev@dpdk.org",
        "Date": "Tue, 11 Sep 2018 10:02:09 +0200",
        "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>",
        "X-Spam-Score": "-0.9",
        "Subject": "[dpdk-dev] [PATCH v3 03/10] event/dsw: add DSW port configuration"
    },
    "content": "Allow port setup and release in the DSW event device.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n drivers/event/dsw/dsw_evdev.c | 60 +++++++++++++++++++++++++++++++++++\n drivers/event/dsw/dsw_evdev.h | 28 ++++++++++++++++\n 2 files changed, 88 insertions(+)",
    "diff": "diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c\nindex 1500d2426..91b1a2449 100644\n--- a/drivers/event/dsw/dsw_evdev.c\n+++ b/drivers/event/dsw/dsw_evdev.c\n@@ -9,6 +9,62 @@\n \n #define EVENTDEV_NAME_DSW_PMD event_dsw\n \n+static int\n+dsw_port_setup(struct rte_eventdev *dev, uint8_t port_id,\n+\t       const struct rte_event_port_conf *conf)\n+{\n+\tstruct dsw_evdev *dsw = dsw_pmd_priv(dev);\n+\tstruct dsw_port *port;\n+\tstruct rte_event_ring *in_ring;\n+\tchar ring_name[RTE_RING_NAMESIZE];\n+\n+\tport = &dsw->ports[port_id];\n+\n+\t*port = (struct dsw_port) {\n+\t\t.id = port_id,\n+\t\t.dsw = dsw,\n+\t\t.dequeue_depth = conf->dequeue_depth,\n+\t\t.enqueue_depth = conf->enqueue_depth,\n+\t\t.new_event_threshold = conf->new_event_threshold\n+\t};\n+\n+\tsnprintf(ring_name, sizeof(ring_name), \"dsw%d_p%u\", dev->data->dev_id,\n+\t\t port_id);\n+\n+\tin_ring = rte_event_ring_create(ring_name, DSW_IN_RING_SIZE,\n+\t\t\t\t\tdev->data->socket_id,\n+\t\t\t\t\tRING_F_SC_DEQ|RING_F_EXACT_SZ);\n+\n+\tif (in_ring == NULL)\n+\t\treturn -ENOMEM;\n+\n+\tport->in_ring = in_ring;\n+\n+\tdev->data->ports[port_id] = port;\n+\n+\treturn 0;\n+}\n+\n+static void\n+dsw_port_def_conf(struct rte_eventdev *dev __rte_unused,\n+\t\t  uint8_t port_id __rte_unused,\n+\t\t  struct rte_event_port_conf *port_conf)\n+{\n+\t*port_conf = (struct rte_event_port_conf) {\n+\t\t.new_event_threshold = 1024,\n+\t\t.dequeue_depth = DSW_MAX_PORT_DEQUEUE_DEPTH / 4,\n+\t\t.enqueue_depth = DSW_MAX_PORT_ENQUEUE_DEPTH / 4\n+\t};\n+}\n+\n+static void\n+dsw_port_release(void *p)\n+{\n+\tstruct dsw_port *port = p;\n+\n+\trte_event_ring_free(port->in_ring);\n+}\n+\n static int\n dsw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,\n \t\tconst struct rte_event_queue_conf *conf)\n@@ -81,12 +137,16 @@ dsw_configure(const struct rte_eventdev *dev)\n \tstruct dsw_evdev *dsw = dsw_pmd_priv(dev);\n \tconst struct rte_event_dev_config *conf = &dev->data->dev_conf;\n \n+\tdsw->num_ports = conf->nb_event_ports;\n \tdsw->num_queues = conf->nb_event_queues;\n \n \treturn 0;\n }\n \n static struct rte_eventdev_ops dsw_evdev_ops = {\n+\t.port_setup = dsw_port_setup,\n+\t.port_def_conf = dsw_port_def_conf,\n+\t.port_release = dsw_port_release,\n \t.queue_setup = dsw_queue_setup,\n \t.queue_def_conf = dsw_queue_def_conf,\n \t.queue_release = dsw_queue_release,\ndiff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h\nindex 5eda8d114..2a4f10421 100644\n--- a/drivers/event/dsw/dsw_evdev.h\n+++ b/drivers/event/dsw/dsw_evdev.h\n@@ -5,6 +5,7 @@\n #ifndef _DSW_EVDEV_H_\n #define _DSW_EVDEV_H_\n \n+#include <rte_event_ring.h>\n #include <rte_eventdev.h>\n \n #define DSW_PMD_NAME RTE_STR(event_dsw)\n@@ -23,6 +24,31 @@\n #define DSW_MAX_FLOWS (1<<(DSW_MAX_FLOWS_BITS))\n #define DSW_MAX_FLOWS_MASK (DSW_MAX_FLOWS-1)\n \n+/* The rings are dimensioned so that all in-flight events can reside\n+ * on any one of the port rings, to avoid the trouble of having to\n+ * care about the case where there's no room on the destination port's\n+ * input ring.\n+ */\n+#define DSW_IN_RING_SIZE (DSW_MAX_EVENTS)\n+\n+struct dsw_port {\n+\tuint16_t id;\n+\n+\t/* Keeping a pointer here to avoid container_of() calls, which\n+\t * are expensive since they are very frequent and will result\n+\t * in an integer multiplication (since the port id is an index\n+\t * into the dsw_evdev port array).\n+\t */\n+\tstruct dsw_evdev *dsw;\n+\n+\tuint16_t dequeue_depth;\n+\tuint16_t enqueue_depth;\n+\n+\tint32_t new_event_threshold;\n+\n+\tstruct rte_event_ring *in_ring __rte_cache_aligned;\n+} __rte_cache_aligned;\n+\n struct dsw_queue {\n \tuint8_t schedule_type;\n \tuint16_t num_serving_ports;\n@@ -31,6 +57,8 @@ struct dsw_queue {\n struct dsw_evdev {\n \tstruct rte_eventdev_data *data;\n \n+\tstruct dsw_port ports[DSW_MAX_PORTS];\n+\tuint16_t num_ports;\n \tstruct dsw_queue queues[DSW_MAX_QUEUES];\n \tuint8_t num_queues;\n };\n",
    "prefixes": [
        "v3",
        "03/10"
    ]
}