get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 59846,
    "url": "http://patchwork.dpdk.org/api/patches/59846/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190926100558.24348-7-pbhagavatula@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20190926100558.24348-7-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190926100558.24348-7-pbhagavatula@marvell.com",
    "date": "2019-09-26T10:05:53",
    "name": "[06/11] examples/l3fwd: add event eth Rx/Tx adapter setup",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8212349bee02bf8569378b379b8f9b61c7c8d6f8",
    "submitter": {
        "id": 1183,
        "url": "http://patchwork.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20190926100558.24348-7-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 6542,
            "url": "http://patchwork.dpdk.org/api/series/6542/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6542",
            "date": "2019-09-26T10:05:47",
            "name": "example/l3fwd: introduce event device support",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/6542/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/59846/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/59846/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 9DCC41BF92;\n\tThu, 26 Sep 2019 12:06:39 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E9B3E1BF8B\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 12:06:35 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx8QA4fID032589; Thu, 26 Sep 2019 03:06:35 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2v8u5dr1b5-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tThu, 26 Sep 2019 03:06:35 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tThu, 26 Sep 2019 03:06:25 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Thu, 26 Sep 2019 03:06:25 -0700",
            "from BG-LT7430.marvell.com (unknown [10.28.17.15])\n\tby maili.marvell.com (Postfix) with ESMTP id F2AA33F7040;\n\tThu, 26 Sep 2019 03:06:21 -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=NnQm9UZspBVapoLuHUB5f9rhUSQOMhoJWA15bsZaxls=;\n\tb=mwepzvKncov7FPGxhSFImhD5h2rz9O4aGfrkmQd6heuB5Itb/bFlnfPg1oIqTEGcAEuy\n\teQoE9ZrcOlx7+4We1KSaRjcuXnWQ0ewOOendicl7KsUw4LqnAtfoOcdr1FQ0d1tr5uSX\n\tdimv4e+96gwUjJrYRBmzrVo0nd4kbusWAJPsVRYULafNz6gtU1B6RpNXg4k+RUBMz8jl\n\tzUF2C89NSlvk1wQ+SZEtJO+ivjgZhTFo2leD4v69iVonym7uPbn7nhZTKTA1slD+vC8I\n\tBv3tWwe0hp1jHTD+iGgGQugvpTwfVlBFV9KCdwrOa6jMqCeRFdC7TM3Gye+H2Iy6YQP+\n\t9w== ",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, <akhil.goyal@nxp.com>, Marko Kovacevic\n\t<marko.kovacevic@intel.com>, Ori Kam <orika@mellanox.com>,\n\tBruce Richardson\n\t<bruce.richardson@intel.com>, Radu Nicolau <radu.nicolau@intel.com>, \n\t\"Tomasz Kantecki\" <tomasz.kantecki@intel.com>",
        "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>, \"Sunil Kumar\n\tKori\" <skori@marvell.com>",
        "Date": "Thu, 26 Sep 2019 15:35:53 +0530",
        "Message-ID": "<20190926100558.24348-7-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190926100558.24348-1-pbhagavatula@marvell.com>",
        "References": "<20190926100558.24348-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.95,1.0.8\n\tdefinitions=2019-09-26_04:2019-09-25,2019-09-26 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 06/11] examples/l3fwd: add event eth Rx/Tx\n\tadapter setup",
        "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": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd event eth Rx/Tx adapter setup for both generic and internal port\nevent device pipelines.\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n examples/l3fwd/l3fwd_eventdev.c               |  3 +\n examples/l3fwd/l3fwd_eventdev.h               | 13 +++\n examples/l3fwd/l3fwd_eventdev_generic.c       | 99 +++++++++++++++++++\n examples/l3fwd/l3fwd_eventdev_internal_port.c | 80 +++++++++++++++\n 4 files changed, 195 insertions(+)",
    "diff": "diff --git a/examples/l3fwd/l3fwd_eventdev.c b/examples/l3fwd/l3fwd_eventdev.c\nindex f5ac3ccce..031705b68 100644\n--- a/examples/l3fwd/l3fwd_eventdev.c\n+++ b/examples/l3fwd/l3fwd_eventdev.c\n@@ -327,4 +327,7 @@ l3fwd_eventdev_resource_setup(struct rte_eth_conf *port_conf)\n \n \t/* Event port configuration */\n \tevdev_rsrc->ops.event_port_setup();\n+\n+\t/* Rx/Tx adapters configuration */\n+\tevdev_rsrc->ops.adapter_setup(ethdev_count);\n }\ndiff --git a/examples/l3fwd/l3fwd_eventdev.h b/examples/l3fwd/l3fwd_eventdev.h\nindex 2640d6cec..127bb7f42 100644\n--- a/examples/l3fwd/l3fwd_eventdev.h\n+++ b/examples/l3fwd/l3fwd_eventdev.h\n@@ -7,6 +7,7 @@\n \n #include <rte_common.h>\n #include <rte_eventdev.h>\n+#include <rte_event_eth_rx_adapter.h>\n #include <rte_event_eth_tx_adapter.h>\n #include <rte_service.h>\n #include <rte_spinlock.h>\n@@ -40,6 +41,16 @@ struct l3fwd_eventdev_ports {\n \trte_spinlock_t lock;\n };\n \n+struct l3fwd_eventdev_rx_adptr {\n+\tuint8_t\tnb_rx_adptr;\n+\tuint8_t *rx_adptr;\n+};\n+\n+struct l3fwd_eventdev_tx_adptr {\n+\tuint8_t\tnb_tx_adptr;\n+\tuint8_t *tx_adptr;\n+};\n+\n struct l3fwd_eventdev_setup_ops {\n \tevent_queue_setup_cb event_queue_setup;\n \tevent_port_setup_cb event_port_setup;\n@@ -50,6 +61,8 @@ struct l3fwd_eventdev_setup_ops {\n \n struct l3fwd_eventdev_resources {\n \tstruct rte_event_port_conf def_p_conf;\n+\tstruct l3fwd_eventdev_rx_adptr rx_adptr;\n+\tstruct l3fwd_eventdev_tx_adptr tx_adptr;\n \tuint8_t disable_implicit_release;\n \tstruct l3fwd_eventdev_setup_ops ops;\n \tstruct rte_mempool * (*pkt_pool)[NB_SOCKETS];\ndiff --git a/examples/l3fwd/l3fwd_eventdev_generic.c b/examples/l3fwd/l3fwd_eventdev_generic.c\nindex 4aec0e403..659a152b6 100644\n--- a/examples/l3fwd/l3fwd_eventdev_generic.c\n+++ b/examples/l3fwd/l3fwd_eventdev_generic.c\n@@ -115,9 +115,108 @@ l3fwd_event_queue_setup_generic(uint16_t ethdev_count,\n \tevdev_rsrc->evq.event_q_id[event_q_id] = event_q_id;\n }\n \n+static void\n+l3fwd_rx_tx_adapter_setup_generic(uint16_t ethdev_count)\n+{\n+\tstruct l3fwd_eventdev_resources *evdev_rsrc = l3fwd_get_eventdev_rsrc();\n+\tstruct rte_event_eth_rx_adapter_queue_conf eth_q_conf = {\n+\t\t.rx_queue_flags = 0,\n+\t\t.ev = {\n+\t\t\t.queue_id = 0,\n+\t\t\t.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,\n+\t\t}\n+\t};\n+\tuint8_t event_d_id = evdev_rsrc->event_d_id;\n+\tuint8_t rx_adptr_id = 0;\n+\tuint8_t tx_adptr_id = 0;\n+\tuint8_t tx_port_id = 0;\n+\tint32_t ret, i;\n+\n+\t/* Rx adapter setup */\n+\tevdev_rsrc->rx_adptr.nb_rx_adptr = 1;\n+\tevdev_rsrc->rx_adptr.rx_adptr = (uint8_t *)malloc(sizeof(uint8_t) *\n+\t\t\t\t\tevdev_rsrc->rx_adptr.nb_rx_adptr);\n+\tif (!evdev_rsrc->rx_adptr.rx_adptr) {\n+\t\tfree(evdev_rsrc->evp.event_p_id);\n+\t\tfree(evdev_rsrc->evq.event_q_id);\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"failed to allocate memery for Rx adapter\");\n+\t}\n+\n+\tret = rte_event_eth_rx_adapter_create(rx_adptr_id, event_d_id,\n+\t\t\t\t\t      &evdev_rsrc->def_p_conf);\n+\tif (ret)\n+\t\trte_exit(EXIT_FAILURE, \"failed to create rx adapter\");\n+\n+\teth_q_conf.ev.sched_type = evdev_rsrc->sync_mode;\n+\tfor (i = 0; i < ethdev_count; i++) {\n+\t\t/* Configure user requested sync mode */\n+\t\teth_q_conf.ev.queue_id = evdev_rsrc->evq.event_q_id[i];\n+\t\tret = rte_event_eth_rx_adapter_queue_add(rx_adptr_id, i, -1,\n+\t\t\t\t\t\t\t &eth_q_conf);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"Failed to add queues to Rx adapter\");\n+\t}\n+\n+\tret = rte_event_eth_rx_adapter_start(rx_adptr_id);\n+\tif (ret)\n+\t\trte_exit(EXIT_FAILURE, \"Rx adapter[%d] start failed\",\n+\t\t\t rx_adptr_id);\n+\n+\tevdev_rsrc->rx_adptr.rx_adptr[0] = rx_adptr_id;\n+\n+\t/* Tx adapter setup */\n+\tevdev_rsrc->tx_adptr.nb_tx_adptr = 1;\n+\tevdev_rsrc->tx_adptr.tx_adptr = (uint8_t *)malloc(sizeof(uint8_t) *\n+\t\t\t\t\tevdev_rsrc->tx_adptr.nb_tx_adptr);\n+\tif (!evdev_rsrc->tx_adptr.tx_adptr) {\n+\t\tfree(evdev_rsrc->rx_adptr.rx_adptr);\n+\t\tfree(evdev_rsrc->evp.event_p_id);\n+\t\tfree(evdev_rsrc->evq.event_q_id);\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"failed to allocate memery for Rx adapter\");\n+\t}\n+\n+\tret = rte_event_eth_tx_adapter_create(tx_adptr_id, event_d_id,\n+\t\t\t\t\t      &evdev_rsrc->def_p_conf);\n+\tif (ret)\n+\t\trte_exit(EXIT_FAILURE, \"failed to create tx adapter[%d]\",\n+\t\t\t tx_adptr_id);\n+\n+\tfor (i = 0; i < ethdev_count; i++) {\n+\t\tret = rte_event_eth_tx_adapter_queue_add(tx_adptr_id, i, -1);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"failed to add queues to Tx adapter\");\n+\t}\n+\n+\tret = rte_event_eth_tx_adapter_event_port_get(tx_adptr_id, &tx_port_id);\n+\tif (ret)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"Failed to get Tx adapter port id: %d\\n\", ret);\n+\n+\tret = rte_event_port_link(event_d_id, tx_port_id,\n+\t\t\t\t  &evdev_rsrc->evq.event_q_id[\n+\t\t\t\t\tevdev_rsrc->evq.nb_queues - 1],\n+\t\t\t\t  NULL, 1);\n+\tif (ret != 1)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"Unable to link Tx adapter port to Tx queue:err = %d\",\n+\t\t\t ret);\n+\n+\tret = rte_event_eth_tx_adapter_start(tx_adptr_id);\n+\tif (ret)\n+\t\trte_exit(EXIT_FAILURE, \"Tx adapter[%d] start failed\",\n+\t\t\t tx_adptr_id);\n+\n+\tevdev_rsrc->tx_adptr.tx_adptr[0] = tx_adptr_id;\n+}\n+\n void\n l3fwd_eventdev_set_generic_ops(struct l3fwd_eventdev_setup_ops *ops)\n {\n \tops->event_queue_setup = l3fwd_event_queue_setup_generic;\n \tops->event_port_setup = l3fwd_event_port_setup_generic;\n+\tops->adapter_setup = l3fwd_rx_tx_adapter_setup_generic;\n }\ndiff --git a/examples/l3fwd/l3fwd_eventdev_internal_port.c b/examples/l3fwd/l3fwd_eventdev_internal_port.c\nindex 363e37899..811c99983 100644\n--- a/examples/l3fwd/l3fwd_eventdev_internal_port.c\n+++ b/examples/l3fwd/l3fwd_eventdev_internal_port.c\n@@ -109,9 +109,89 @@ l3fwd_event_queue_setup_internal_port(uint16_t ethdev_count,\n \t}\n }\n \n+static void\n+l3fwd_rx_tx_adapter_setup_internal_port(uint16_t ethdev_count)\n+{\n+\tstruct l3fwd_eventdev_resources *evdev_rsrc = l3fwd_get_eventdev_rsrc();\n+\tstruct rte_event_eth_rx_adapter_queue_conf eth_q_conf = {\n+\t\t.rx_queue_flags = 0,\n+\t\t.ev = {\n+\t\t\t.queue_id = 0,\n+\t\t\t.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,\n+\t\t}\n+\t};\n+\tuint8_t event_d_id = evdev_rsrc->event_d_id;\n+\tint32_t ret, i;\n+\n+\tevdev_rsrc->rx_adptr.nb_rx_adptr = ethdev_count;\n+\tevdev_rsrc->rx_adptr.rx_adptr = (uint8_t *)malloc(sizeof(uint8_t) *\n+\t\t\t\t\tevdev_rsrc->rx_adptr.nb_rx_adptr);\n+\tif (!evdev_rsrc->rx_adptr.rx_adptr) {\n+\t\tfree(evdev_rsrc->evp.event_p_id);\n+\t\tfree(evdev_rsrc->evq.event_q_id);\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"failed to allocate memery for Rx adapter\");\n+\t}\n+\n+\tfor (i = 0; i < ethdev_count; i++) {\n+\t\tret = rte_event_eth_rx_adapter_create(i, event_d_id,\n+\t\t\t\t\t\t&evdev_rsrc->def_p_conf);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"failed to create rx adapter[%d]\", i);\n+\n+\t\t/* Configure user requested sync mode */\n+\t\teth_q_conf.ev.queue_id = evdev_rsrc->evq.event_q_id[i];\n+\t\teth_q_conf.ev.sched_type = evdev_rsrc->sync_mode;\n+\t\tret = rte_event_eth_rx_adapter_queue_add(i, i, -1, &eth_q_conf);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"Failed to add queues to Rx adapter\");\n+\n+\t\tret = rte_event_eth_rx_adapter_start(i);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"Rx adapter[%d] start failed\", i);\n+\n+\t\tevdev_rsrc->rx_adptr.rx_adptr[i] = i;\n+\t}\n+\n+\tevdev_rsrc->tx_adptr.nb_tx_adptr = ethdev_count;\n+\tevdev_rsrc->tx_adptr.tx_adptr = (uint8_t *)malloc(sizeof(uint8_t) *\n+\t\t\t\t\tevdev_rsrc->tx_adptr.nb_tx_adptr);\n+\tif (!evdev_rsrc->tx_adptr.tx_adptr) {\n+\t\tfree(evdev_rsrc->rx_adptr.rx_adptr);\n+\t\tfree(evdev_rsrc->evp.event_p_id);\n+\t\tfree(evdev_rsrc->evq.event_q_id);\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"failed to allocate memery for Rx adapter\");\n+\t}\n+\n+\tfor (i = 0; i < ethdev_count; i++) {\n+\t\tret = rte_event_eth_tx_adapter_create(i, event_d_id,\n+\t\t\t\t\t\t&evdev_rsrc->def_p_conf);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"failed to create tx adapter[%d]\", i);\n+\n+\t\tret = rte_event_eth_tx_adapter_queue_add(i, i, -1);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"failed to add queues to Tx adapter\");\n+\n+\t\tret = rte_event_eth_tx_adapter_start(i);\n+\t\tif (ret)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t \"Tx adapter[%d] start failed\", i);\n+\n+\t\tevdev_rsrc->tx_adptr.tx_adptr[i] = i;\n+\t}\n+}\n+\n void\n l3fwd_eventdev_set_internal_port_ops(struct l3fwd_eventdev_setup_ops *ops)\n {\n \tops->event_queue_setup = l3fwd_event_queue_setup_internal_port;\n \tops->event_port_setup = l3fwd_event_port_setup_internal_port;\n+\tops->adapter_setup = l3fwd_rx_tx_adapter_setup_internal_port;\n }\n",
    "prefixes": [
        "06/11"
    ]
}