get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 40919,
    "url": "https://patches.dpdk.org/api/patches/40919/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1528478659-15859-20-git-send-email-anoob.joseph@caviumnetworks.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1528478659-15859-20-git-send-email-anoob.joseph@caviumnetworks.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1528478659-15859-20-git-send-email-anoob.joseph@caviumnetworks.com",
    "date": "2018-06-08T17:24:18",
    "name": "[dpdk-dev,19/20] eventdev: add routine to launch eventmode workers",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "7c1c0a0b4db03ab5a80e4dfc495dbc8dba6f8eca",
    "submitter": {
        "id": 893,
        "url": "https://patches.dpdk.org/api/people/893/?format=api",
        "name": "Anoob Joseph",
        "email": "anoob.joseph@caviumnetworks.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1528478659-15859-20-git-send-email-anoob.joseph@caviumnetworks.com/mbox/",
    "series": [
        {
            "id": 61,
            "url": "https://patches.dpdk.org/api/series/61/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=61",
            "date": "2018-06-08T17:23:59",
            "name": "add eventmode helper functions",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/61/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/40919/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/40919/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 AC7CB1D0A0;\n\tFri,  8 Jun 2018 19:26:10 +0200 (CEST)",
            "from NAM03-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam03on0065.outbound.protection.outlook.com [104.47.42.65])\n\tby dpdk.org (Postfix) with ESMTP id 98AC51D0A0\n\tfor <dev@dpdk.org>; Fri,  8 Jun 2018 19:26:08 +0200 (CEST)",
            "from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2)\n\tby DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17;\n\tFri, 8 Jun 2018 17:26:03 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=yWQOru0m6c0y0Dr2Uk6MiRSya4iJuwmYYNVdP26taHc=;\n\tb=HSSbuOVbDmuYOJPKK/wBKukio50elqXnhazu2HbUqbv2lCUwghEu8BoSvveEU0AISe78qt3BqP3hG5I6n+DG2idYsViDqD48/eDAtQeguTr+Y0iDn6AIdwsRrBS0N1WFusOoIXOB0RGinOkBWHo/sRExk8LUxQXsfN/zea/hn/M=",
        "Authentication-Results": "spf=none (sender IP is )\n\tsmtp.mailfrom=Anoob.Joseph@cavium.com; ",
        "From": "Anoob Joseph <anoob.joseph@caviumnetworks.com>",
        "To": "Bruce Richardson <bruce.richardson@intel.com>,\n\tJerin Jacob <jerin.jacob@caviumnetworks.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Cc": "Anoob Joseph <anoob.joseph@caviumnetworks.com>,\n\tHemant Agrawal <hemant.agrawal@nxp.com>,\n\tNarayana Prasad <narayanaprasad.athreya@caviumnetworks.com>,\n\tNikhil Rao <nikhil.rao@intel.com>,\n\tPavan Nikhilesh <pbhagavatula@caviumnetworks.com>,\n\tSunil Kumar Kori <sunil.kori@nxp.com>, dev@dpdk.org",
        "Date": "Fri,  8 Jun 2018 22:54:18 +0530",
        "Message-Id": "<1528478659-15859-20-git-send-email-anoob.joseph@caviumnetworks.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com>",
        "References": "<1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[115.113.156.2]",
        "X-ClientProxiedBy": "BM1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM\n\t(2603:1096:b00:19::12) To DM6PR07MB4906.namprd07.prod.outlook.com\n\t(2603:10b6:5:a3::11)",
        "X-MS-PublicTrafficType": "Email",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);\n\tSRVR:DM6PR07MB4906; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; DM6PR07MB4906;\n\t3:POFPSewyZqKCE1j40+bMv7+QN9rLx+MN+uK2/CsQ2xo1FMcqRf/lV9TBPUQmq0EYh9aNUaraQ4/eGPuTVENPmaG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9FEzWaKyyN+pmjND/vufPM1ZgUkCtHr3rW45pxpLC5Vz6sKtF5qM3o5KhpfWiFyknZaWjL0xN4gg/fzrUh8OIp+zDH5eR3j2ITkvwJwqboIruTfrYe6jhsjeP8gbm7ozNRfQ/9V+IFxkdxzeC16UQFGKgRPr8V22uuJrYVUP2wnbpoYVgDOzfr1pyE5zrEp6cC3/5S/MyEuPje0pgFxbd/3KXdlgfXBn48j9ZgWjQbN2AP88mu/9hitnbw1ansRKv7f5Y8ySBlQNDAqFfBVP3yYsKo1X3BuvCf6dwYq27W5NC1MVC7Grg==;\n\t5:CYDRKd3comnqRV88ovlo1AR9ejtHnmyRoA36pNlTHODo0B9bukTH+LKMa6RMPE/ZZhs7HX/sQsuToLErSCuLxdhdKW8tEBHW6iF3+Fzno0Ei8zzOV7c4KmvF5sbjDeD+PlQKI6TyRFhrPjxBHng6PB52DZ8SDrHiI4laI8DSrow=;\n\t24:dzLaxBZRL9zjm1/4GHhPnA+HayFB++rQVlFbgJH4KV+mGIw7A8jKUsQxG5MJrU2Q88jRSRfO510w8ghBhX3i+rUt11lnPcBc4tiW098fGgE=",
            "1; DM6PR07MB4906;\n\t7:qYYFjaG0rGHXapSbZ4aSRiyR2LhDqpiF5HMErlMY3VZ9Nc76c/0NXPloBB2yYnsbdnznfzWTPFq/AccU5h85XiDp+eSzY0cv/Cl5Cad17Vsgjpzs6fzwGQki9FLzZcTzKxeBYwOBaNzMSrQjFt32GmoCUE+xS5t3zvx2To48MJOFoomFSwqs7JkwCAQT+ZCkvP3ZmMyqM2ovB2BG+7qskZX+wp+yursBbGwp0owbw9AMJzZM2g6ODRCjkvDzBnu/"
        ],
        "X-MS-TrafficTypeDiagnostic": "DM6PR07MB4906:",
        "X-Microsoft-Antispam-PRVS": "<DM6PR07MB490674FF3FA16E091FBF7F3CF87B0@DM6PR07MB4906.namprd07.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);\n\tSRVR:DM6PR07MB4906; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4906; ",
        "X-Forefront-PRVS": "06973FFAD3",
        "X-Forefront-Antispam-Report": "SFV:NSPM;\n\tSFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(189003)(199004)(186003)(16526019)(5660300001)(26005)(42882007)(55236004)(66066001)(47776003)(68736007)(6666003)(305945005)(2906002)(8676002)(7736002)(8936002)(36756003)(52116002)(2616005)(956004)(476003)(446003)(50226002)(81166006)(11346002)(44832011)(6506007)(386003)(486006)(59450400001)(76176011)(51416003)(48376002)(50466002)(97736004)(316002)(6512007)(25786009)(53936002)(6486002)(81156014)(4326008)(3846002)(6116002)(16586007)(54906003)(110136005)(105586002)(106356001)(72206003)(478600001)(8656006);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4906;\n\tH:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None;\n\tLANG:en; PTR:InfoNoRecords; MX:1; A:1; ",
        "Received-SPF": "None (protection.outlook.com: cavium.com does not designate\n\tpermitted sender hosts)",
        "X-Microsoft-Antispam-Message-Info": "8O7bnP5hn0wF1Mtfln0rRaq5HXY+hkM2jH7pHMRlg6bW48hWwJzfHOAFkCCUzVJMOeenzjoBotGHf9zojAWm+mpmXKIxq1lsfNZOXFgjNxYQ+IwwtFv2MBYtIFRjemFQKPVbU2KjSOSvhuoKn14e2HzS/2Jm3wqfS4y50/HDDHuOrAPScAnvPkp8y/kJfCEo",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Office365-Filtering-Correlation-Id": "5b498528-d3a9-4dee-c0fb-08d5cd64eb18",
        "X-OriginatorOrg": "caviumnetworks.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "08 Jun 2018 17:26:03.9515\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "5b498528-d3a9-4dee-c0fb-08d5cd64eb18",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "711e4ccf-2e9b-4bcf-a551-4094005b6194",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM6PR07MB4906",
        "Subject": "[dpdk-dev] [PATCH 19/20] eventdev: add routine to launch eventmode\n\tworkers",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "With eventmode, workers could be drafted differently according to the\ncapabilities of the underlying event device. The added function would\nreceive an array of such workers and probes the eventmode properties to\nchoose the worker.\n\nSigned-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>\n---\n lib/librte_eventdev/rte_eventmode_helper.c         | 299 +++++++++++++++++++++\n lib/librte_eventdev/rte_eventmode_helper.h         |  57 ++++\n .../rte_eventmode_helper_internal.h                |  23 ++\n 3 files changed, 379 insertions(+)",
    "diff": "diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c\nindex 7f2d269..25cb4a9 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper.c\n+++ b/lib/librte_eventdev/rte_eventmode_helper.c\n@@ -2,6 +2,7 @@\n  * Copyright(c) 2018 Cavium, Inc\n  */\n #include <getopt.h>\n+#include <stdbool.h>\n \n #include <rte_ethdev.h>\n #include <rte_eventdev.h>\n@@ -13,6 +14,9 @@\n \n #define CMD_LINE_OPT_TRANSFER_MODE\t\"transfer-mode\"\n \n+static volatile bool rx_core_running;\n+static volatile bool eventmode_worker_stop;\n+\n static const char short_options[] =\n \t\"\"\n \t;\n@@ -110,6 +114,16 @@ internal_get_next_active_core(struct eventmode_conf *em_conf,\n \treturn next_core;\n }\n \n+static inline bool\n+internal_dev_has_burst_mode(uint8_t dev_id)\n+{\n+\tstruct rte_event_dev_info dev_info;\n+\n+\trte_event_dev_info_get(dev_id, &dev_info);\n+\treturn (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE) ?\n+\t\t\ttrue : false;\n+}\n+\n /* Global functions */\n \n void\n@@ -992,3 +1006,288 @@ rte_eventmode_helper_get_tx_queue(struct rte_eventmode_helper_conf *mode_conf,\n \treturn eventdev_config->nb_eventqueue;\n }\n \n+/* Helper functions for launching workers */\n+\n+static int32_t\n+rte_eventmode_helper_start_worker_rx_core(struct eventmode_conf *em_conf,\n+\t\tuint32_t lcore_id)\n+{\n+\tuint32_t service_id[EVENT_MODE_MAX_ADAPTERS_PER_RX_CORE];\n+\tstruct rx_adapter_conf *adapter;\n+\tint service_count = 0;\n+\tint adapter_id;\n+\tint32_t ret;\n+\tint i;\n+\n+\tRTE_EM_HLPR_LOG_INFO(\n+\t\t\"Entering rx_core processing on lcore %u\", lcore_id);\n+\n+\t/*\n+\t * Need to parse adapter conf to see which all adapters need to be\n+\t * handled this core.\n+\t */\n+\tfor (i = 0; i < em_conf->nb_rx_adapter; i++) {\n+\t\t/* Check if we have exceeded the max allowed */\n+\t\tif (service_count > EVENT_MODE_MAX_ADAPTERS_PER_RX_CORE) {\n+\t\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\t\"Exceeded the max allowed adapters per rx core\");\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tadapter = &(em_conf->adapter[i]);\n+\t\tif (adapter->rx_core_id != lcore_id)\n+\t\t\tcontinue;\n+\n+\t\t/* Adapter need to be handled by this core */\n+\t\tadapter_id = adapter->adapter_id;\n+\n+\t\t/* Get the service ID for the adapters */\n+\t\tret = rte_event_eth_rx_adapter_service_id_get(adapter_id,\n+\t\t\t\t&(service_id[service_count]));\n+\n+\t\tif (ret != -ESRCH && ret != 0) {\n+\t\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\t\"Error getting service ID used by adapter\");\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\t/* Update service count */\n+\t\tservice_count++;\n+\t}\n+\n+\trx_core_running = true;\n+\n+\twhile (rx_core_running) {\n+\t\tfor (i = 0; i < service_count; i++) {\n+\t\t\t/* Initiate rx_adapter service */\n+\t\t\trte_service_run_iter_on_app_lcore(service_id[i], 0);\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int32_t\n+rte_eventmode_helper_stop_worker_rx_core(void)\n+{\n+\tif (rx_core_running) {\n+\t\tRTE_EM_HLPR_LOG_INFO(\"Stopping rx cores\\n\");\n+\t\trx_core_running = false;\n+\t}\n+\treturn 0;\n+}\n+\n+static struct rte_eventmode_helper_app_worker_params *\n+rte_eventmode_helper_find_worker(uint32_t lcore_id,\n+\t\tstruct eventmode_conf *em_conf,\n+\t\tstruct rte_eventmode_helper_app_worker_params *app_wrkrs,\n+\t\tuint8_t nb_wrkr_param)\n+{\n+\tstruct rte_eventmode_helper_event_link_info *link = NULL;\n+\tuint8_t eventdev_id;\n+\tstruct eventdev_params *eventdev_config;\n+\tint i;\n+\tstruct rte_eventmode_helper_app_worker_params curr_conf = {0};\n+\tstruct rte_eventmode_helper_app_worker_params *tmp_wrkr;\n+\n+\t/*\n+\t * Event device to be used will be derived from the first lcore-event\n+\t * link.\n+\t *\n+\t * Assumption: All lcore-event link tied to a core would be using the\n+\t * same event device. in other words, one core would be polling on\n+\t * queues of a single event device only.\n+\t */\n+\n+\t/* Get a link for this lcore */\n+\tfor (i = 0; i < em_conf->nb_link; i++) {\n+\t\tlink = &(em_conf->link[i]);\n+\t\tif (link->lcore_id == lcore_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (link == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\"No valid link found for lcore(%d)\", lcore_id);\n+\t\treturn NULL;\n+\t}\n+\n+\t/* Get event dev ID */\n+\teventdev_id = link->eventdev_id;\n+\n+\t/* Get the corresponding eventdev config */\n+\teventdev_config = internal_get_eventdev_params(em_conf, eventdev_id);\n+\n+\t/* Populate the curr_conf with the capabilities */\n+\n+\t/* Check for burst mode */\n+\tif (internal_dev_has_burst_mode(eventdev_id))\n+\t\tcurr_conf.cap.burst = RTE_EVENTMODE_HELPER_RX_TYPE_BURST;\n+\telse\n+\t\tcurr_conf.cap.burst = RTE_EVENTMODE_HELPER_RX_TYPE_NON_BURST;\n+\n+\tcurr_conf.cap.s1_sched_type =\n+\t\t\trte_eventmode_helper_get_s1_sched_type(em_conf);\n+\n+\tcurr_conf.cap.s2_sched_type =\n+\t\t\trte_eventmode_helper_get_s2_sched_type(em_conf);\n+\n+\t/* TODO make this part of em_conf */\n+\tcurr_conf.nb_stage = 1;\n+\n+\t/* Now parse the passed list and see if we have matching capabilties */\n+\n+\t/* Initialize the pointer used to traverse the list */\n+\ttmp_wrkr = app_wrkrs;\n+\n+\tfor (i = 0; i < nb_wrkr_param; i++, tmp_wrkr++) {\n+\n+\t\t/* Skip this if capabilities are not matching */\n+\t\tif (tmp_wrkr->cap.u64 != curr_conf.cap.u64)\n+\t\t\tcontinue;\n+\n+\t\t/* Skip if the number of stages is not matching */\n+\t\tif (tmp_wrkr->nb_stage != curr_conf.nb_stage)\n+\t\t\tcontinue;\n+\n+\t\t/* If the checks pass, we have a match */\n+\t\treturn tmp_wrkr;\n+\t}\n+\n+\t/* TODO required for ATQ */\n+\tRTE_SET_USED(eventdev_config);\n+\n+\treturn NULL;\n+}\n+\n+static int\n+rte_eventmode_helper_verify_match_worker(\n+\tstruct rte_eventmode_helper_app_worker_params *match_wrkr)\n+{\n+\tif (match_wrkr->nb_stage == 0) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"App stages cannot be 0\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* Verify the stages registered */\n+\tswitch (match_wrkr->nb_stage) {\n+\tcase 2:\n+\t\tif (match_wrkr->s2_worker_thread == NULL) {\n+\t\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\t\"No worker registered for second stage\");\n+\t\t\treturn 0;\n+\t\t}\n+\t\t/* Fall through */\n+\tcase 1:\n+\t\tif (match_wrkr->s1_worker_thread == NULL) {\n+\t\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\t\"No worker registered for first stage\");\n+\t\t\treturn 0;\n+\t\t}\n+\t\tbreak;\n+\tdefault:\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Only two stages are supported now\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* Success */\n+\treturn 1;\n+}\n+\n+void\n+rte_eventmode_helper_launch_worker(struct rte_eventmode_helper_conf *mode_conf,\n+\t\tstruct rte_eventmode_helper_app_worker_params *app_wrkr,\n+\t\tuint8_t nb_wrkr_param)\n+{\n+\tstruct rte_eventmode_helper_app_worker_params *match_wrkr;\n+\tuint32_t lcore_id;\n+\tint i;\n+\tstruct eventmode_conf *em_conf;\n+\n+\tif (mode_conf == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Invalid conf\");\n+\t\treturn;\n+\t}\n+\n+\tif (mode_conf->mode_params == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Invalid mode params\");\n+\t\treturn;\n+\t}\n+\n+\t/* Get eventmode conf */\n+\tem_conf = (struct eventmode_conf *)(mode_conf->mode_params);\n+\n+\t/* Get core ID */\n+\tlcore_id = rte_lcore_id();\n+\n+\t/* TODO check capability for rx core */\n+\n+\t/* Check if this is rx core */\n+\tif (em_conf->rx_core_mask & (1 << lcore_id)) {\n+\t\trte_eventmode_helper_start_worker_rx_core(em_conf, lcore_id);\n+\t\treturn;\n+\t}\n+\n+\tif (app_wrkr == NULL || nb_wrkr_param == 0) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Invalid args\");\n+\t\treturn;\n+\t}\n+\n+\t/*\n+\t * This is a regular worker thread. The application would be\n+\t * registering multiple workers with various capabilities. The\n+\t * worker to be run will be selected by the capabilities of the\n+\t * event device configured.\n+\t */\n+\n+\t/* Get the first matching worker for the event device */\n+\tmatch_wrkr = rte_eventmode_helper_find_worker(lcore_id,\n+\t\t\tem_conf,\n+\t\t\tapp_wrkr,\n+\t\t\tnb_wrkr_param);\n+\n+\tif (match_wrkr == NULL) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\n+\t\t\t\"No matching worker registered for lcore %d\", lcore_id);\n+\t\tgoto clean_and_exit;\n+\t}\n+\n+\t/* Verify sanity of the matched worker */\n+\tif (rte_eventmode_helper_verify_match_worker(match_wrkr) != 1) {\n+\t\tRTE_EM_HLPR_LOG_ERR(\"Error in validating the matched worker\");\n+\t\tgoto clean_and_exit;\n+\t}\n+\n+\t/*\n+\t * If single stage, then the worker thread will have the loop,\n+\t * thereby avoiding the dereferencing of the function pointer.\n+\t */\n+\tif (match_wrkr->nb_stage == 1) {\n+\t\tmatch_wrkr->s1_worker_thread((void *)mode_conf);\n+\t\tgoto clean_and_exit;\n+\t}\n+\n+\t/* TODO write worker stop API */\n+\teventmode_worker_stop = false;\n+\n+\t/* Run the worker threads */\n+\twhile (!eventmode_worker_stop) {\n+\n+\t\t/* Launch the stages registered */\n+\t\tfor (i = 1; i <= match_wrkr->nb_stage; i++) {\n+\t\t\tswitch (i) {\n+\t\t\tcase 1:\n+\t\t\t\tmatch_wrkr->s1_worker_thread((void *)em_conf);\n+\t\t\t\tbreak;\n+\t\t\tcase 2:\n+\t\t\t\tmatch_wrkr->s2_worker_thread((void *)em_conf);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+clean_and_exit:\n+\n+\t/* Flag rx_cores to stop, if started */\n+\trte_eventmode_helper_stop_worker_rx_core();\n+}\ndiff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h\nindex be2fe8d..25b1180 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper.h\n+++ b/lib/librte_eventdev/rte_eventmode_helper.h\n@@ -12,6 +12,22 @@ enum rte_eventmode_helper_pkt_transfer_mode {\n \tRTE_EVENTMODE_HELPER_PKT_TRANSFER_MODE_EVENT,\n };\n \n+/* Event mode packet rx types */\n+enum rte_eventmode_helper_rx_types {\n+\tRTE_EVENTMODE_HELPER_RX_TYPE_INVALID = 0,\n+\tRTE_EVENTMODE_HELPER_RX_TYPE_NON_BURST,\n+\tRTE_EVENTMODE_HELPER_RX_TYPE_BURST,\n+\tRTE_EVENTMODE_HELPER_RX_TYPE_MAX = 16\n+};\n+\n+/* Event mode packet tx types */\n+enum rte_eventmode_helper_tx_types {\n+\tRTE_EVETNMODE_HELPER_TX_TYPE_INVALID = 0,\n+\tRTE_EVENTMODE_HELPER_TX_TYPE_LOCKED,\n+\tRTE_EVENTMODE_HELPER_TX_TYPE_LOCKLESS,\n+\tRTE_EVENTMODE_HELPER_TX_TYPE_MAX = 16\n+};\n+\n struct rte_eventmode_helper_conf {\n \tenum rte_eventmode_helper_pkt_transfer_mode mode;\n \t\t/**< Packet transfer mode of the application */\n@@ -36,6 +52,27 @@ struct rte_eventmode_helper_event_link_info {\n \t\t/**< Lcore to be polling on this port */\n };\n \n+/* Workers registered by the application */\n+struct rte_eventmode_helper_app_worker_params {\n+\tunion {\n+\t\tstruct {\n+\t\t\tuint64_t burst : 4;\n+\t\t\t/**< Specify status of rx type burst */\n+\t\t\tuint64_t s1_sched_type : 2;\n+\t\t\t/**< Stage 1 scheduling type for the thread */\n+\t\t\tuint64_t s2_sched_type : 2;\n+\t\t\t/**< Stage 2 scheduling type for the thread */\n+\t\t};\n+\t\tuint64_t u64;\n+\t} cap;\n+\t\t\t/**< Capabilities of this worker */\n+\tuint8_t nb_stage;\n+\tvoid (*s1_worker_thread)(void *);\n+\t\t\t/**< Stage 1 worker thread */\n+\tvoid (*s2_worker_thread)(void *);\n+\t\t\t/**< Stage 2 worker thread */\n+};\n+\n /* Common helper functions for command line parsing */\n \n /**\n@@ -152,5 +189,25 @@ uint8_t\n rte_eventmode_helper_get_tx_queue(struct rte_eventmode_helper_conf *mode_conf,\n \t\tuint8_t eventdev_id);\n \n+/**\n+ * Launch eventmode worker\n+ *\n+ * The application can request the eventmode helper subsystem to launch the\n+ * worker based on the capabilities of event device and the options selected\n+ * while initializing the eventmode.\n+ *\n+ * @param mode_conf\n+ *   Configuration of the mode in which app is doing packet handling\n+ * @param app_wrkr\n+ *   List of all the workers registered by application, along with it's\n+ *   capabilties\n+ * @param nb_wrkr_param\n+ *   Number of workers passed by the application\n+ *\n+ */\n+void\n+rte_eventmode_helper_launch_worker(struct rte_eventmode_helper_conf *mode_conf,\n+\t\tstruct rte_eventmode_helper_app_worker_params *app_wrkr,\n+\t\tuint8_t nb_wrkr_param);\n \n #endif /* _RTE_EVENTMODE_HELPER_H_ */\ndiff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h\nindex 3a4e52f..996c654 100644\n--- a/lib/librte_eventdev/rte_eventmode_helper_internal.h\n+++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h\n@@ -43,6 +43,9 @@\n #define EVENT_MODE_MAX_LCORE_LINKS \\\n \t(EVENT_MODE_MAX_EVENT_DEVS * EVENT_MODE_MAX_EVENT_QUEUES_PER_DEV)\n \n+/* Max adapters that one rx core can handle */\n+#define EVENT_MODE_MAX_ADAPTERS_PER_RX_CORE EVENT_MODE_MAX_RX_ADAPTERS\n+\n /* Event dev params */\n struct eventdev_params {\n \tuint8_t eventdev_id;\n@@ -104,4 +107,24 @@ struct eventmode_conf {\n \t\t/**< 64 bit field to specify extended params */\n };\n \n+/*\n+ * Get sched type of the first stage of app\n+ *\n+ */\n+static inline uint8_t\n+rte_eventmode_helper_get_s1_sched_type(struct eventmode_conf *em_conf)\n+{\n+\treturn em_conf->ext_params.s1_sched_type;\n+}\n+\n+/*\n+ * Get sched type of the first stage of app\n+ *\n+ */\n+static inline uint8_t\n+rte_eventmode_helper_get_s2_sched_type(struct eventmode_conf *em_conf)\n+{\n+\treturn em_conf->ext_params.s2_sched_type;\n+}\n+\n #endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "19/20"
    ]
}