get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64921,
    "url": "http://patches.dpdk.org/api/patches/64921/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1579527918-360-3-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": "<1579527918-360-3-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579527918-360-3-git-send-email-anoobj@marvell.com",
    "date": "2020-01-20T13:45:08",
    "name": "[v2,02/12] examples/ipsec-secgw: add framework for eventmode helper",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c27fbfbb20733aa4635ca661fb43232c0f4886dc",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1579527918-360-3-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 8219,
            "url": "http://patches.dpdk.org/api/series/8219/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8219",
            "date": "2020-01-20T13:45:06",
            "name": "add eventmode to ipsec-secgw",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/8219/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64921/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64921/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 8F90AA0528;\n\tMon, 20 Jan 2020 14:46:07 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CDBD13253;\n\tMon, 20 Jan 2020 14:45:57 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id D3B7A3253\n for <dev@dpdk.org>; Mon, 20 Jan 2020 14:45:55 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 00KDjSSh023756; Mon, 20 Jan 2020 05:45:55 -0800",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 2xm2dsx465-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 20 Jan 2020 05:45:55 -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; Mon, 20 Jan\n 2020 05:45:52 -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; Mon, 20 Jan 2020 05:45:52 -0800",
            "from ajoseph83.caveonetworks.com (unknown [10.29.45.60])\n by maili.marvell.com (Postfix) with ESMTP id 0E7453F703F;\n Mon, 20 Jan 2020 05:45:48 -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=7Z+znwutINFNt06twGeBNiksEQsQP50M4G4CRaNr0+o=;\n b=hZ8vSpLilhBQH81/reMmqG5Dy0mZK7yyk7+FtzE0TmRUbsKQhKTI0nRRfKOGlnzY/cQV\n RfTYgBbJN8xfFuSIra4PbxS1xyn6j0h0YkQ7iHg9txRaB4ZN5i//oK1/IAwk4pRi+Njq\n FaY/FmQAfHoEFdJO435/6GBNNaOp10Z1iXtxGFzmljhPnda4rwg8L7T9lq5gvOToNwvu\n qlmGyjPUBu8XQo2QGMq+cuKQ4+1IOaEUtFr/plKwJUo64UjMu395RkmEdJjKoUBshqPc\n 8znv2lVOM7kdJoN1UrrVw55/5mMGRzeFfLVxfqaY3Cfsc2pdbXOV4EL9PnWh8p+fhVVR 4w==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Akhil Goyal <akhil.goyal@nxp.com>, Radu Nicolau <radu.nicolau@intel.com>,\n Thomas Monjalon <thomas@monjalon.net>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Jerin Jacob <jerinj@marvell.com>,\n Narayana Prasad <pathreya@marvell.com>,\n Ankur Dwivedi <adwivedi@marvell.com>,\n Archana Muniganti <marchana@marvell.com>, Tejasree Kondoj\n <ktejasree@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>, \"Lukasz\n Bartosik\" <lbartosik@marvell.com>, Konstantin Ananyev\n <konstantin.ananyev@intel.com>, <dev@dpdk.org>",
        "Date": "Mon, 20 Jan 2020 19:15:08 +0530",
        "Message-ID": "<1579527918-360-3-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1579527918-360-1-git-send-email-anoobj@marvell.com>",
        "References": "<1575808249-31135-1-git-send-email-anoobj@marvell.com>\n <1579527918-360-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:6.0.138, 18.0.572\n definitions=2020-01-20_02:2020-01-20,\n 2020-01-20 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v2 02/12] examples/ipsec-secgw: add framework for\n\teventmode helper",
        "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": "Add framework for eventmode helper. Event mode involves\ninitialization of multiple devices like eventdev, ethdev\nand etc. Add routines to initialize and uninitialize event\ndevice. Generate a default config for event device if it\nis not specified in the configuration. Currently event\nhelper supports single event device only.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n examples/ipsec-secgw/Makefile       |   1 +\n examples/ipsec-secgw/event_helper.c | 326 ++++++++++++++++++++++++++++++++++++\n examples/ipsec-secgw/event_helper.h | 115 +++++++++++++\n examples/ipsec-secgw/meson.build    |   4 +-\n 4 files changed, 444 insertions(+), 2 deletions(-)\n create mode 100644 examples/ipsec-secgw/event_helper.c\n create mode 100644 examples/ipsec-secgw/event_helper.h",
    "diff": "diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile\nindex a4977f6..09e3c5a 100644\n--- a/examples/ipsec-secgw/Makefile\n+++ b/examples/ipsec-secgw/Makefile\n@@ -15,6 +15,7 @@ SRCS-y += sa.c\n SRCS-y += rt.c\n SRCS-y += ipsec_process.c\n SRCS-y += ipsec-secgw.c\n+SRCS-y += event_helper.c\n \n CFLAGS += -gdwarf-2\n \ndiff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c\nnew file mode 100644\nindex 0000000..82425de\n--- /dev/null\n+++ b/examples/ipsec-secgw/event_helper.c\n@@ -0,0 +1,326 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (C) 2020 Marvell International Ltd.\n+ */\n+#include <rte_ethdev.h>\n+#include <rte_eventdev.h>\n+\n+#include \"event_helper.h\"\n+\n+static int\n+eh_set_default_conf_eventdev(struct eventmode_conf *em_conf)\n+{\n+\tstruct eventdev_params *eventdev_config;\n+\tstruct rte_event_dev_info dev_info;\n+\tint lcore_count;\n+\tint nb_eventdev;\n+\tint nb_eth_dev;\n+\tint ret;\n+\n+\t/* Get the number of event devices */\n+\tnb_eventdev = rte_event_dev_count();\n+\tif (nb_eventdev == 0) {\n+\t\tEH_LOG_ERR(\"No event devices detected\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (nb_eventdev != 1) {\n+\t\tEH_LOG_ERR(\"Event mode does not support multiple event devices. \"\n+\t\t\t   \"Please provide only one event device.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the number of eth devs */\n+\tnb_eth_dev = rte_eth_dev_count_avail();\n+\tif (nb_eth_dev == 0) {\n+\t\tEH_LOG_ERR(\"No eth devices detected\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the number of lcores */\n+\tlcore_count = rte_lcore_count();\n+\n+\t/* Read event device info */\n+\tret = rte_event_dev_info_get(0, &dev_info);\n+\tif (ret < 0) {\n+\t\tEH_LOG_ERR(\"Failed to read event device info %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Check if enough ports are available */\n+\tif (dev_info.max_event_ports < 2) {\n+\t\tEH_LOG_ERR(\"Not enough event ports available\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the first event dev conf */\n+\teventdev_config = &(em_conf->eventdev_config[0]);\n+\n+\t/* Save number of queues & ports available */\n+\teventdev_config->eventdev_id = 0;\n+\teventdev_config->nb_eventqueue = dev_info.max_event_queues;\n+\teventdev_config->nb_eventport = dev_info.max_event_ports;\n+\teventdev_config->ev_queue_mode =\n+\t\t\tRTE_EVENT_QUEUE_CFG_ALL_TYPES;\n+\n+\t/* Check if there are more queues than required */\n+\tif (eventdev_config->nb_eventqueue > nb_eth_dev + 1) {\n+\t\t/* One queue is reserved for Tx */\n+\t\teventdev_config->nb_eventqueue = nb_eth_dev + 1;\n+\t}\n+\n+\t/* Check if there are more ports than required */\n+\tif (eventdev_config->nb_eventport > lcore_count) {\n+\t\t/* One port per lcore is enough */\n+\t\teventdev_config->nb_eventport = lcore_count;\n+\t}\n+\n+\t/* Update the number of event devices */\n+\tem_conf->nb_eventdev++;\n+\n+\treturn 0;\n+}\n+\n+static int\n+eh_validate_conf(struct eventmode_conf *em_conf)\n+{\n+\tint ret;\n+\n+\t/*\n+\t * Check if event devs are specified. Else probe the event devices\n+\t * and initialize the config with all ports & queues available\n+\t */\n+\tif (em_conf->nb_eventdev == 0) {\n+\t\tret = eh_set_default_conf_eventdev(em_conf);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+eh_initialize_eventdev(struct eventmode_conf *em_conf)\n+{\n+\tstruct rte_event_queue_conf eventq_conf = {0};\n+\tstruct rte_event_dev_info evdev_default_conf;\n+\tstruct rte_event_dev_config eventdev_conf;\n+\tstruct eventdev_params *eventdev_config;\n+\tint nb_eventdev = em_conf->nb_eventdev;\n+\tuint8_t eventdev_id;\n+\tint nb_eventqueue;\n+\tuint8_t i, j;\n+\tint ret;\n+\n+\tfor (i = 0; i < nb_eventdev; i++) {\n+\n+\t\t/* Get eventdev config */\n+\t\teventdev_config = &(em_conf->eventdev_config[i]);\n+\n+\t\t/* Get event dev ID */\n+\t\teventdev_id = eventdev_config->eventdev_id;\n+\n+\t\t/* Get the number of queues */\n+\t\tnb_eventqueue = eventdev_config->nb_eventqueue;\n+\n+\t\t/* Reset the default conf */\n+\t\tmemset(&evdev_default_conf, 0,\n+\t\t\tsizeof(struct rte_event_dev_info));\n+\n+\t\t/* Get default conf of eventdev */\n+\t\tret = rte_event_dev_info_get(eventdev_id, &evdev_default_conf);\n+\t\tif (ret < 0) {\n+\t\t\tEH_LOG_ERR(\n+\t\t\t\t\"Error in getting event device info[devID:%d]\",\n+\t\t\t\teventdev_id);\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tmemset(&eventdev_conf, 0, sizeof(struct rte_event_dev_config));\n+\t\teventdev_conf.nb_events_limit =\n+\t\t\t\tevdev_default_conf.max_num_events;\n+\t\teventdev_conf.nb_event_queues = nb_eventqueue;\n+\t\teventdev_conf.nb_event_ports =\n+\t\t\t\teventdev_config->nb_eventport;\n+\t\teventdev_conf.nb_event_queue_flows =\n+\t\t\t\tevdev_default_conf.max_event_queue_flows;\n+\t\teventdev_conf.nb_event_port_dequeue_depth =\n+\t\t\t\tevdev_default_conf.max_event_port_dequeue_depth;\n+\t\teventdev_conf.nb_event_port_enqueue_depth =\n+\t\t\t\tevdev_default_conf.max_event_port_enqueue_depth;\n+\n+\t\t/* Configure event device */\n+\t\tret = rte_event_dev_configure(eventdev_id, &eventdev_conf);\n+\t\tif (ret < 0) {\n+\t\t\tEH_LOG_ERR(\"Error in configuring event device\");\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\t/* Configure event queues */\n+\t\tfor (j = 0; j < nb_eventqueue; j++) {\n+\n+\t\t\tmemset(&eventq_conf, 0,\n+\t\t\t\t\tsizeof(struct rte_event_queue_conf));\n+\n+\t\t\t/* Read the requested conf */\n+\n+\t\t\t/* Per event dev queues can be ATQ or SINGLE LINK */\n+\t\t\teventq_conf.event_queue_cfg =\n+\t\t\t\t\teventdev_config->ev_queue_mode;\n+\t\t\t/*\n+\t\t\t * All queues need to be set with sched_type as\n+\t\t\t * schedule type for the application stage. One queue\n+\t\t\t * would be reserved for the final eth tx stage. This\n+\t\t\t * will be an atomic queue.\n+\t\t\t */\n+\t\t\tif (j == nb_eventqueue-1) {\n+\t\t\t\teventq_conf.schedule_type =\n+\t\t\t\t\tRTE_SCHED_TYPE_ATOMIC;\n+\t\t\t} else {\n+\t\t\t\teventq_conf.schedule_type =\n+\t\t\t\t\tem_conf->ext_params.sched_type;\n+\t\t\t}\n+\n+\t\t\t/* Set max atomic flows to 1024 */\n+\t\t\teventq_conf.nb_atomic_flows = 1024;\n+\t\t\teventq_conf.nb_atomic_order_sequences = 1024;\n+\n+\t\t\t/* Setup the queue */\n+\t\t\tret = rte_event_queue_setup(eventdev_id, j,\n+\t\t\t\t\t&eventq_conf);\n+\t\t\tif (ret < 0) {\n+\t\t\t\tEH_LOG_ERR(\"Failed to setup event queue %d\",\n+\t\t\t\t\t   ret);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\n+\t\t/* Configure event ports */\n+\t\tfor (j = 0; j <  eventdev_config->nb_eventport; j++) {\n+\t\t\tret = rte_event_port_setup(eventdev_id, j, NULL);\n+\t\t\tif (ret < 0) {\n+\t\t\t\tEH_LOG_ERR(\"Failed to setup event port %d\",\n+\t\t\t\t\t   ret);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t/* Start event devices */\n+\tfor (i = 0; i < nb_eventdev; i++) {\n+\n+\t\t/* Get eventdev config */\n+\t\teventdev_config = &(em_conf->eventdev_config[i]);\n+\n+\t\tret = rte_event_dev_start(eventdev_config->eventdev_id);\n+\t\tif (ret < 0) {\n+\t\t\tEH_LOG_ERR(\"Failed to start event device %d, %d\",\n+\t\t\t\t   i, ret);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+int32_t\n+eh_devs_init(struct eh_conf *conf)\n+{\n+\tstruct eventmode_conf *em_conf;\n+\tuint16_t port_id;\n+\tint ret;\n+\n+\tif (conf == NULL) {\n+\t\tEH_LOG_ERR(\"Invalid event helper configuration\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (conf->mode != EH_PKT_TRANSFER_MODE_EVENT)\n+\t\treturn 0;\n+\n+\tif (conf->mode_params == NULL) {\n+\t\tEH_LOG_ERR(\"Invalid event mode parameters\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get eventmode conf */\n+\tem_conf = conf->mode_params;\n+\n+\t/* Validate the requested config */\n+\tret = eh_validate_conf(em_conf);\n+\tif (ret < 0) {\n+\t\tEH_LOG_ERR(\"Failed to validate the requested config %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Stop eth devices before setting up adapter */\n+\tRTE_ETH_FOREACH_DEV(port_id) {\n+\n+\t\t/* Use only the ports enabled */\n+\t\tif ((conf->eth_portmask & (1 << port_id)) == 0)\n+\t\t\tcontinue;\n+\n+\t\trte_eth_dev_stop(port_id);\n+\t}\n+\n+\t/* Setup eventdev */\n+\tret = eh_initialize_eventdev(em_conf);\n+\tif (ret < 0) {\n+\t\tEH_LOG_ERR(\"Failed to initialize event dev %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Start eth devices after setting up adapter */\n+\tRTE_ETH_FOREACH_DEV(port_id) {\n+\n+\t\t/* Use only the ports enabled */\n+\t\tif ((conf->eth_portmask & (1 << port_id)) == 0)\n+\t\t\tcontinue;\n+\n+\t\tret = rte_eth_dev_start(port_id);\n+\t\tif (ret < 0) {\n+\t\t\tEH_LOG_ERR(\"Failed to start eth dev %d, %d\",\n+\t\t\t\t   port_id, ret);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int32_t\n+eh_devs_uninit(struct eh_conf *conf)\n+{\n+\tstruct eventmode_conf *em_conf;\n+\tuint16_t id;\n+\tint ret, i;\n+\n+\tif (conf == NULL) {\n+\t\tEH_LOG_ERR(\"Invalid event helper configuration\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (conf->mode != EH_PKT_TRANSFER_MODE_EVENT)\n+\t\treturn 0;\n+\n+\tif (conf->mode_params == NULL) {\n+\t\tEH_LOG_ERR(\"Invalid event mode parameters\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get eventmode conf */\n+\tem_conf = conf->mode_params;\n+\n+\t/* Stop and release event devices */\n+\tfor (i = 0; i < em_conf->nb_eventdev; i++) {\n+\n+\t\tid = em_conf->eventdev_config[i].eventdev_id;\n+\t\trte_event_dev_stop(id);\n+\n+\t\tret = rte_event_dev_close(id);\n+\t\tif (ret < 0) {\n+\t\t\tEH_LOG_ERR(\"Failed to close event dev %d, %d\", id, ret);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/examples/ipsec-secgw/event_helper.h b/examples/ipsec-secgw/event_helper.h\nnew file mode 100644\nindex 0000000..7685987\n--- /dev/null\n+++ b/examples/ipsec-secgw/event_helper.h\n@@ -0,0 +1,115 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (C) 2020 Marvell International Ltd.\n+ */\n+#ifndef _EVENT_HELPER_H_\n+#define _EVENT_HELPER_H_\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_log.h>\n+\n+#define RTE_LOGTYPE_EH  RTE_LOGTYPE_USER4\n+\n+#define EH_LOG_ERR(...) \\\n+\tRTE_LOG(ERR, EH, \\\n+\t\tRTE_FMT(\"%s() line %u: \" RTE_FMT_HEAD(__VA_ARGS__ ,) \"\\n\", \\\n+\t\t\t__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))\n+\n+/* Max event devices supported */\n+#define EVENT_MODE_MAX_EVENT_DEVS RTE_EVENT_MAX_DEVS\n+\n+/**\n+ * Packet transfer mode of the application\n+ */\n+enum eh_pkt_transfer_mode {\n+\tEH_PKT_TRANSFER_MODE_POLL = 0,\n+\tEH_PKT_TRANSFER_MODE_EVENT,\n+};\n+\n+/* Event dev params */\n+struct eventdev_params {\n+\tuint8_t eventdev_id;\n+\tuint8_t nb_eventqueue;\n+\tuint8_t nb_eventport;\n+\tuint8_t ev_queue_mode;\n+};\n+\n+/* Eventmode conf data */\n+struct eventmode_conf {\n+\tint nb_eventdev;\n+\t\t/**< No of event devs */\n+\tstruct eventdev_params eventdev_config[EVENT_MODE_MAX_EVENT_DEVS];\n+\t\t/**< Per event dev conf */\n+\tunion {\n+\t\tRTE_STD_C11\n+\t\tstruct {\n+\t\t\tuint64_t sched_type\t\t\t: 2;\n+\t\t/**< Schedule type */\n+\t\t};\n+\t\tuint64_t u64;\n+\t} ext_params;\n+\t\t/**< 64 bit field to specify extended params */\n+};\n+\n+/**\n+ * Event helper configuration\n+ */\n+struct eh_conf {\n+\tenum eh_pkt_transfer_mode mode;\n+\t\t/**< Packet transfer mode of the application */\n+\tuint32_t eth_portmask;\n+\t\t/**<\n+\t\t * Mask of the eth ports to be used. This portmask would be\n+\t\t * checked while initializing devices using helper routines.\n+\t\t */\n+\tvoid *mode_params;\n+\t\t/**< Mode specific parameters */\n+};\n+\n+/**\n+ * Initialize event mode devices\n+ *\n+ * Application can call this function to get the event devices, eth devices\n+ * and eth rx & tx adapters initialized according to the default config or\n+ * config populated using the command line args.\n+ *\n+ * Application is expected to initialize the eth devices and then the event\n+ * mode helper subsystem will stop & start eth devices according to its\n+ * requirement. Call to this function should be done after the eth devices\n+ * are successfully initialized.\n+ *\n+ * @param conf\n+ *   Event helper configuration\n+ * @return\n+ *  - 0 on success.\n+ *  - (<0) on failure.\n+ */\n+int32_t\n+eh_devs_init(struct eh_conf *conf);\n+\n+/**\n+ * Release event mode devices\n+ *\n+ * Application can call this function to release event devices,\n+ * eth rx & tx adapters according to the config.\n+ *\n+ * Call to this function should be done before application stops\n+ * and closes eth devices. This function will not close and stop\n+ * eth devices.\n+ *\n+ * @param conf\n+ *   Event helper configuration\n+ * @return\n+ *  - 0 on success.\n+ *  - (<0) on failure.\n+ */\n+int32_t\n+eh_devs_uninit(struct eh_conf *conf);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _EVENT_HELPER_H_ */\ndiff --git a/examples/ipsec-secgw/meson.build b/examples/ipsec-secgw/meson.build\nindex 9ece345..20f4064 100644\n--- a/examples/ipsec-secgw/meson.build\n+++ b/examples/ipsec-secgw/meson.build\n@@ -6,9 +6,9 @@\n # To build this example as a standalone application with an already-installed\n # DPDK instance, use 'make'\n \n-deps += ['security', 'lpm', 'acl', 'hash', 'ip_frag', 'ipsec']\n+deps += ['security', 'lpm', 'acl', 'hash', 'ip_frag', 'ipsec', 'eventdev']\n allow_experimental_apis = true\n sources = files(\n \t'esp.c', 'ipsec.c', 'ipsec_process.c', 'ipsec-secgw.c',\n-\t'parser.c', 'rt.c', 'sa.c', 'sp4.c', 'sp6.c'\n+\t'parser.c', 'rt.c', 'sa.c', 'sp4.c', 'sp6.c', 'event_helper.c'\n )\n",
    "prefixes": [
        "v2",
        "02/12"
    ]
}