get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65060,
    "url": "http://patches.dpdk.org/api/patches/65060/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200122182817.1667-4-pbhagavatula@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": "<20200122182817.1667-4-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200122182817.1667-4-pbhagavatula@marvell.com",
    "date": "2020-01-22T18:28:09",
    "name": "[v4,03/11] examples/l3fwd: add event device configuration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8afe0626135165730e34d297aebfbc03384a144c",
    "submitter": {
        "id": 1183,
        "url": "http://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@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/20200122182817.1667-4-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 8269,
            "url": "http://patches.dpdk.org/api/series/8269/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8269",
            "date": "2020-01-22T18:28:06",
            "name": "example/l3fwd: introduce event device support",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/8269/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65060/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/65060/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C8574A0532;\n\tWed, 22 Jan 2020 19:28:54 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7721C3772;\n\tWed, 22 Jan 2020 19:28:37 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D4570374E\n for <dev@dpdk.org>; Wed, 22 Jan 2020 19:28:35 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 00MIKNYU014750; Wed, 22 Jan 2020 10:28:35 -0800",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 2xpm901xn4-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 22 Jan 2020 10:28:35 -0800",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jan\n 2020 10:28:33 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 22 Jan 2020 10:28:33 -0800",
            "from BG-LT7430.marvell.com (unknown [10.28.17.83])\n by maili.marvell.com (Postfix) with ESMTP id 7C3B03F703F;\n Wed, 22 Jan 2020 10:28:30 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=uEmKoVz8i9tmxoZv+axyRKzzYFb688nwWn0gL/w7Wq0=;\n b=dc7bxv6yDpQOKk7uxhspsyGWI7ECLlU8+/1b41Y7yUPXlBsbgCQ3H1Z36X+Uy0ofhbEU\n 1YGoW92IxYBm+8aq45IQsq4ktDCVnlXaBeILvp20E8EhyJN4A030W2guPLlBYpE3UYo0\n 6ue3Imjhja1MkEPehtZRfIgzwbA/UeJlgAsCUVXaHSX+qXnit3tz2QetzeDwP/wAxDU3\n rxIzgSR4v33weFsnnwRF5FARxxC8JCQywiQRboND8ragBnaOdYYzOPdUce7EShuvicI9\n /Iv8xDtqWjJQEJkmhzjjmE7604ewWBO6BXiqrmJsXeY6P9eIhXYQoCqBqJSKVeN2uRCa Zg==",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, <konstantin.ananyev@intel.com>, Marko Kovacevic\n <marko.kovacevic@intel.com>, Ori Kam <orika@mellanox.com>, Bruce Richardson\n <bruce.richardson@intel.com>, Radu Nicolau <radu.nicolau@intel.com>, \"Akhil\n Goyal\" <akhil.goyal@nxp.com>, Tomasz Kantecki <tomasz.kantecki@intel.com>,\n Sunil Kumar Kori <skori@marvell.com>, Pavan Nikhilesh\n <pbhagavatula@marvell.com>",
        "CC": "<dev@dpdk.org>",
        "Date": "Wed, 22 Jan 2020 23:58:09 +0530",
        "Message-ID": "<20200122182817.1667-4-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200122182817.1667-1-pbhagavatula@marvell.com>",
        "References": "<20200111134730.5329-1-pbhagavatula@marvell.com>\n <20200122182817.1667-1-pbhagavatula@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-01-22_08:2020-01-22,\n 2020-01-22 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v4 03/11] examples/l3fwd: add event device\n\tconfiguration",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd event device configuration based on the capabilities of the\nprobed event device.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n examples/l3fwd/l3fwd_event.c               |  3 +\n examples/l3fwd/l3fwd_event.h               | 36 ++++++++++\n examples/l3fwd/l3fwd_event_generic.c       | 76 +++++++++++++++++++++-\n examples/l3fwd/l3fwd_event_internal_port.c | 76 +++++++++++++++++++++-\n 4 files changed, 189 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c\nindex 62218f3ca..9cb46c711 100644\n--- a/examples/l3fwd/l3fwd_event.c\n+++ b/examples/l3fwd/l3fwd_event.c\n@@ -68,4 +68,7 @@ l3fwd_event_resource_setup(void)\n \n \t/* Setup eventdev capability callbacks */\n \tl3fwd_event_capability_setup();\n+\n+\t/* Event device configuration */\n+\tevt_rsrc->ops.event_device_setup();\n }\ndiff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h\nindex d25c8d222..fc3862ec1 100644\n--- a/examples/l3fwd/l3fwd_event.h\n+++ b/examples/l3fwd/l3fwd_event.h\n@@ -8,6 +8,7 @@\n #include <rte_common.h>\n #include <rte_eventdev.h>\n #include <rte_event_eth_tx_adapter.h>\n+#include <rte_service.h>\n #include <rte_spinlock.h>\n \n #include \"l3fwd.h\"\n@@ -18,6 +19,29 @@ typedef void (*event_port_setup_cb)(void);\n typedef void (*adapter_setup_cb)(void);\n typedef int (*event_loop_cb)(void *);\n \n+struct l3fwd_event_queues {\n+\tuint8_t *event_q_id;\n+\tuint8_t\tnb_queues;\n+};\n+\n+struct l3fwd_event_ports {\n+\tuint8_t *event_p_id;\n+\tuint8_t\tnb_ports;\n+\trte_spinlock_t lock;\n+};\n+\n+struct l3fwd_event_rx_adptr {\n+\tuint32_t service_id;\n+\tuint8_t\tnb_rx_adptr;\n+\tuint8_t *rx_adptr;\n+};\n+\n+struct l3fwd_event_tx_adptr {\n+\tuint32_t service_id;\n+\tuint8_t\tnb_tx_adptr;\n+\tuint8_t *tx_adptr;\n+};\n+\n struct l3fwd_event_setup_ops {\n \tevent_device_setup_cb event_device_setup;\n \tevent_queue_setup_cb event_queue_setup;\n@@ -28,9 +52,21 @@ struct l3fwd_event_setup_ops {\n };\n \n struct l3fwd_event_resources {\n+\tstruct rte_event_port_conf def_p_conf;\n+\tstruct l3fwd_event_rx_adptr rx_adptr;\n+\tstruct l3fwd_event_tx_adptr tx_adptr;\n+\tuint8_t disable_implicit_release;\n \tstruct l3fwd_event_setup_ops ops;\n+\tstruct rte_mempool * (*pkt_pool)[NB_SOCKETS];\n+\tstruct l3fwd_event_queues evq;\n+\tstruct l3fwd_event_ports evp;\n+\tuint32_t port_mask;\n+\tuint8_t per_port_pool;\n+\tuint8_t event_d_id;\n \tuint8_t sched_type;\n \tuint8_t tx_mode_q;\n+\tuint8_t deq_depth;\n+\tuint8_t has_burst;\n \tuint8_t enabled;\n \tuint8_t eth_rx_queues;\n };\ndiff --git a/examples/l3fwd/l3fwd_event_generic.c b/examples/l3fwd/l3fwd_event_generic.c\nindex 7fff850e5..c831cfd66 100644\n--- a/examples/l3fwd/l3fwd_event_generic.c\n+++ b/examples/l3fwd/l3fwd_event_generic.c\n@@ -7,8 +7,82 @@\n #include \"l3fwd.h\"\n #include \"l3fwd_event.h\"\n \n+static uint32_t\n+l3fwd_event_device_setup_generic(void)\n+{\n+\tstruct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();\n+\tstruct rte_event_dev_config event_d_conf = {\n+\t\t.nb_events_limit  = 4096,\n+\t\t.nb_event_queue_flows = 1024,\n+\t\t.nb_event_port_dequeue_depth = 128,\n+\t\t.nb_event_port_enqueue_depth = 128\n+\t};\n+\tstruct rte_event_dev_info dev_info;\n+\tconst uint8_t event_d_id = 0; /* Always use first event device only */\n+\tuint32_t event_queue_cfg = 0;\n+\tuint16_t ethdev_count = 0;\n+\tuint16_t num_workers = 0;\n+\tuint16_t port_id;\n+\tint ret;\n+\n+\tRTE_ETH_FOREACH_DEV(port_id) {\n+\t\tif ((evt_rsrc->port_mask & (1 << port_id)) == 0)\n+\t\t\tcontinue;\n+\t\tethdev_count++;\n+\t}\n+\n+\t/* Event device configurtion */\n+\trte_event_dev_info_get(event_d_id, &dev_info);\n+\t/* Enable implicit release */\n+\tif (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE)\n+\t\tevt_rsrc->disable_implicit_release = 0;\n+\n+\tif (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES)\n+\t\tevent_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES;\n+\n+\t/* One queue for each ethdev port + one Tx adapter Single link queue. */\n+\tevent_d_conf.nb_event_queues = ethdev_count + 1;\n+\tif (dev_info.max_event_queues < event_d_conf.nb_event_queues)\n+\t\tevent_d_conf.nb_event_queues = dev_info.max_event_queues;\n+\n+\tif (dev_info.max_num_events < event_d_conf.nb_events_limit)\n+\t\tevent_d_conf.nb_events_limit = dev_info.max_num_events;\n+\n+\tif (dev_info.max_event_queue_flows < event_d_conf.nb_event_queue_flows)\n+\t\tevent_d_conf.nb_event_queue_flows =\n+\t\t\t\t\t\tdev_info.max_event_queue_flows;\n+\n+\tif (dev_info.max_event_port_dequeue_depth <\n+\t\t\t\tevent_d_conf.nb_event_port_dequeue_depth)\n+\t\tevent_d_conf.nb_event_port_dequeue_depth =\n+\t\t\t\tdev_info.max_event_port_dequeue_depth;\n+\n+\tif (dev_info.max_event_port_enqueue_depth <\n+\t\t\t\tevent_d_conf.nb_event_port_enqueue_depth)\n+\t\tevent_d_conf.nb_event_port_enqueue_depth =\n+\t\t\t\tdev_info.max_event_port_enqueue_depth;\n+\n+\tnum_workers = rte_lcore_count() - rte_service_lcore_count();\n+\tif (dev_info.max_event_ports < num_workers)\n+\t\tnum_workers = dev_info.max_event_ports;\n+\n+\tevent_d_conf.nb_event_ports = num_workers;\n+\tevt_rsrc->evp.nb_ports = num_workers;\n+\tevt_rsrc->evq.nb_queues = event_d_conf.nb_event_queues;\n+\n+\tevt_rsrc->has_burst = !!(dev_info.event_dev_cap &\n+\t\t\t\t    RTE_EVENT_DEV_CAP_BURST_MODE);\n+\n+\tret = rte_event_dev_configure(event_d_id, &event_d_conf);\n+\tif (ret < 0)\n+\t\trte_panic(\"Error in configuring event device\\n\");\n+\n+\tevt_rsrc->event_d_id = event_d_id;\n+\treturn event_queue_cfg;\n+}\n+\n void\n l3fwd_event_set_generic_ops(struct l3fwd_event_setup_ops *ops)\n {\n-\tRTE_SET_USED(ops);\n+\tops->event_device_setup = l3fwd_event_device_setup_generic;\n }\ndiff --git a/examples/l3fwd/l3fwd_event_internal_port.c b/examples/l3fwd/l3fwd_event_internal_port.c\nindex 085e9c825..f3e1ab3a2 100644\n--- a/examples/l3fwd/l3fwd_event_internal_port.c\n+++ b/examples/l3fwd/l3fwd_event_internal_port.c\n@@ -7,8 +7,82 @@\n #include \"l3fwd.h\"\n #include \"l3fwd_event.h\"\n \n+static uint32_t\n+l3fwd_event_device_setup_internal_port(void)\n+{\n+\tstruct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();\n+\tstruct rte_event_dev_config event_d_conf = {\n+\t\t.nb_events_limit  = 4096,\n+\t\t.nb_event_queue_flows = 1024,\n+\t\t.nb_event_port_dequeue_depth = 128,\n+\t\t.nb_event_port_enqueue_depth = 128\n+\t};\n+\tstruct rte_event_dev_info dev_info;\n+\tconst uint8_t event_d_id = 0; /* Always use first event device only */\n+\tuint32_t event_queue_cfg = 0;\n+\tuint16_t ethdev_count = 0;\n+\tuint16_t num_workers = 0;\n+\tuint16_t port_id;\n+\tint ret;\n+\n+\tRTE_ETH_FOREACH_DEV(port_id) {\n+\t\tif ((evt_rsrc->port_mask & (1 << port_id)) == 0)\n+\t\t\tcontinue;\n+\t\tethdev_count++;\n+\t}\n+\n+\t/* Event device configurtion */\n+\trte_event_dev_info_get(event_d_id, &dev_info);\n+\n+\t/* Enable implicit release */\n+\tif (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE)\n+\t\tevt_rsrc->disable_implicit_release = 0;\n+\n+\tif (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES)\n+\t\tevent_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES;\n+\n+\tevent_d_conf.nb_event_queues = ethdev_count;\n+\tif (dev_info.max_event_queues < event_d_conf.nb_event_queues)\n+\t\tevent_d_conf.nb_event_queues = dev_info.max_event_queues;\n+\n+\tif (dev_info.max_num_events < event_d_conf.nb_events_limit)\n+\t\tevent_d_conf.nb_events_limit = dev_info.max_num_events;\n+\n+\tif (dev_info.max_event_queue_flows < event_d_conf.nb_event_queue_flows)\n+\t\tevent_d_conf.nb_event_queue_flows =\n+\t\t\t\t\t\tdev_info.max_event_queue_flows;\n+\n+\tif (dev_info.max_event_port_dequeue_depth <\n+\t\t\t\tevent_d_conf.nb_event_port_dequeue_depth)\n+\t\tevent_d_conf.nb_event_port_dequeue_depth =\n+\t\t\t\tdev_info.max_event_port_dequeue_depth;\n+\n+\tif (dev_info.max_event_port_enqueue_depth <\n+\t\t\t\tevent_d_conf.nb_event_port_enqueue_depth)\n+\t\tevent_d_conf.nb_event_port_enqueue_depth =\n+\t\t\t\tdev_info.max_event_port_enqueue_depth;\n+\n+\tnum_workers = rte_lcore_count();\n+\tif (dev_info.max_event_ports < num_workers)\n+\t\tnum_workers = dev_info.max_event_ports;\n+\n+\tevent_d_conf.nb_event_ports = num_workers;\n+\tevt_rsrc->evp.nb_ports = num_workers;\n+\tevt_rsrc->evq.nb_queues = event_d_conf.nb_event_queues;\n+\tevt_rsrc->has_burst = !!(dev_info.event_dev_cap &\n+\t\t\t\t    RTE_EVENT_DEV_CAP_BURST_MODE);\n+\n+\tret = rte_event_dev_configure(event_d_id, &event_d_conf);\n+\tif (ret < 0)\n+\t\trte_panic(\"Error in configuring event device\\n\");\n+\n+\tevt_rsrc->event_d_id = event_d_id;\n+\treturn event_queue_cfg;\n+}\n+\n+\n void\n l3fwd_event_set_internal_port_ops(struct l3fwd_event_setup_ops *ops)\n {\n-\tRTE_SET_USED(ops);\n+\tops->event_device_setup = l3fwd_event_device_setup_internal_port;\n }\n",
    "prefixes": [
        "v4",
        "03/11"
    ]
}