Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/54263/?format=api
http://patches.dpdk.org/api/patches/54263/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559583160-13944-39-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": "<1559583160-13944-39-git-send-email-anoobj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1559583160-13944-39-git-send-email-anoobj@marvell.com", "date": "2019-06-03T17:32:38", "name": "[38/39] examples/l2fwd-event: add eventmode worker", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "549f37622d3432dd1c1b67946257881e0cedfd65", "submitter": { "id": 1205, "url": "http://patches.dpdk.org/api/people/1205/?format=api", "name": "Anoob Joseph", "email": "anoobj@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/1559583160-13944-39-git-send-email-anoobj@marvell.com/mbox/", "series": [ { "id": 4868, "url": "http://patches.dpdk.org/api/series/4868/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4868", "date": "2019-06-03T17:32:00", "name": "adding eventmode helper library", "version": 1, "mbox": "http://patches.dpdk.org/series/4868/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/54263/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/54263/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 902FB1B9EA;\n\tMon, 3 Jun 2019 19:41:22 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4D9891B9EA\n\tfor <dev@dpdk.org>; Mon, 3 Jun 2019 19:41:21 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx53HfKH2011646; Mon, 3 Jun 2019 10:41:20 -0700", "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr77g-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 03 Jun 2019 10:41:20 -0700", "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 3 Jun 2019 10:37:14 -0700", "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 3 Jun 2019 10:37:13 -0700", "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56])\n\tby maili.marvell.com (Postfix) with ESMTP id 597F13F703F;\n\tMon, 3 Jun 2019 10:37:08 -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=8DFewbAkFwJZ7sKIOtFGZT8Uv+RsZNqSawxyqN/dDEY=;\n\tb=coCzU17AfgKKHq27U29QZ0DACUY/loAEnlohjsVGelmtN99S6d/cI4G4MFgefzmBZYWP\n\ttLEKONSbpipHfEzwmxnZ8TrEOrmSQxwjhbzkO4OEjsyMW61iK/7Li85NbkFIcAN9PCSA\n\tZ4HAHKeu+kG0Lp/th0AJIr+XmCfYPaacPI1KewWCdG1lIKIVoiZOeFN+AtGtdVtDxyJN\n\t2Y1nmlAHEP5cVcPnkx4Ru9kkEqmsCUJ29h6gAIfrE0s8YorfBOB5CwY/il7a0ObrGWe1\n\tr91tskA5mmR28jsleS7AX2cNo/BZHbG9VlOD8jLb7pjz2v5fXKZFSFKRzAwsaqObQNjq\n\tqw== ", "From": "Anoob Joseph <anoobj@marvell.com>", "To": "Jerin Jacob <jerinj@marvell.com>, Nikhil Rao <nikhil.rao@intel.com>,\n\t\"Erik Gabriel Carrillo\" <erik.g.carrillo@intel.com>, Abhinandan Gujjar\n\t<abhinandan.gujjar@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>", "CC": "Anoob Joseph <anoobj@marvell.com>, Narayana Prasad <pathreya@marvell.com>,\n\t<dev@dpdk.org>, Lukasz Bartosik <lbartosik@marvell.com>, Pavan Nikhilesh\n\t<pbhagavatula@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n\t\"Nipun Gupta\" <nipun.gupta@nxp.com>, Harry van Haaren\n\t<harry.van.haaren@intel.com>, =?utf-8?q?Mattias_R=C3=B6nnblom?=\n\t<mattias.ronnblom@ericsson.com>, Liang Ma <liang.j.ma@intel.com>", "Date": "Mon, 3 Jun 2019 23:02:38 +0530", "Message-ID": "<1559583160-13944-39-git-send-email-anoobj@marvell.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>", "References": "<1559583160-13944-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:, ,\n\tdefinitions=2019-06-03_14:, , signatures=0", "Subject": "[dpdk-dev] [PATCH 38/39] examples/l2fwd-event: add eventmode worker", "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": "Adding burst no Tx internal-port eventmode worker\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n examples/l2fwd-event/l2fwd_worker.c | 219 +++++++++++++++++++++++++++++++++++-\n 1 file changed, 218 insertions(+), 1 deletion(-)", "diff": "diff --git a/examples/l2fwd-event/l2fwd_worker.c b/examples/l2fwd-event/l2fwd_worker.c\nindex 0a413a4..251c546 100644\n--- a/examples/l2fwd-event/l2fwd_worker.c\n+++ b/examples/l2fwd-event/l2fwd_worker.c\n@@ -315,7 +315,7 @@ l2fwd_poll_mode_worker(void)\n */\n \n /* Workers registered */\n-#define L2FWD_EVENTMODE_WORKERS\t\t2\n+#define L2FWD_EVENTMODE_WORKERS\t\t3\n \n /*\n * Event mode worker\n@@ -639,6 +639,214 @@ l2fwd_eventmode_non_burst_tx_internal_port(void *args)\n \t\trte_free(links);\n }\n \n+/*\n+ * Event mode worker\n+ * Operating mode : burst no internal port (regular tx worker)\n+ */\n+static void\n+l2fwd_eventmode_burst_no_internal_port(void *args)\n+{\n+\tstruct rte_event ev[MAX_PKT_BURST];\n+\tstruct rte_mbuf *pkt;\n+\tstruct rte_eventmode_helper_conf *mode_conf;\n+\tstruct rte_eventmode_helper_event_link_info *links = NULL;\n+\tunsigned int lcore_nb_link = 0;\n+\tuint32_t lcore_id;\n+\tunsigned int i, j, left, nb_rx = 0;\n+\tunsigned int portid;\n+\tstruct lcore_queue_conf *qconf;\n+\tint is_master_core;\n+\tstruct rte_event_port_conf event_port_conf;\n+\tuint16_t deq_len = 0, enq_len = 0;\n+\tuint8_t tx_queue;\n+\tstruct tsc_tracker tsc = {0};\n+\n+\t/* Get core ID */\n+\tlcore_id = rte_lcore_id();\n+\n+\tRTE_LOG(INFO, L2FWD,\n+\t\t\"Launching event mode burst worker no internal port \"\n+\t\t\"(regular tx worker) on lcore %d\\n\", lcore_id);\n+\n+\t/* Set the flag if master core */\n+\tis_master_core = (lcore_id == rte_get_master_lcore()) ? 1 : 0;\n+\n+\t/* Get qconf for this core */\n+\tqconf = &lcore_queue_conf[lcore_id];\n+\n+\t/* Set drain tsc */\n+\ttsc.drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /\n+\t\t\tUS_PER_S * BURST_TX_DRAIN_US;\n+\n+\t/* Mode conf will be passed as args */\n+\tmode_conf = (struct rte_eventmode_helper_conf *)args;\n+\n+\t/* Get the links configured for this lcore */\n+\tlcore_nb_link = rte_eventmode_helper_get_event_lcore_links(lcore_id,\n+\t\t\tmode_conf, &links);\n+\n+\t/* Check if we have links registered for this lcore */\n+\tif (lcore_nb_link == 0) {\n+\t\t/* No links registered. The core could do periodic drains */\n+\t\tl2fwd_drain_loop(qconf, &tsc, is_master_core);\n+\t\tgoto clean_and_exit;\n+\t}\n+\n+\t/* We have valid links */\n+\n+\t/* Reset stats before proceeding */\n+\treset_eth_stats(is_master_core);\n+\n+\t/*\n+\t * There is no internal port between ethdev and eventdev. So the worker\n+\t * thread needs to submit event to a designated tx queue. Internally\n+\t * eth core would receive events from multiple worker threads and send\n+\t * out packets on wire.\n+\t */\n+\ttx_queue = rte_eventmode_helper_get_tx_queue(mode_conf,\n+\t\t\t\t\t\t links[0].eventdev_id);\n+\n+\t/* Get the burst size of the event device */\n+\n+\t/* Get the default conf of the first link */\n+\trte_event_port_default_conf_get(links[0].eventdev_id,\n+\t\t\tlinks[0].event_portid,\n+\t\t\t&event_port_conf);\n+\n+\t/* Save the burst size */\n+\tdeq_len = event_port_conf.dequeue_depth;\n+\tenq_len = event_port_conf.enqueue_depth;\n+\n+\t/* Dequeue and enqueue length should not exceed MAX_PKT_BURST */\n+\tif (deq_len > MAX_PKT_BURST)\n+\t\tdeq_len = MAX_PKT_BURST;\n+\tif (enq_len > MAX_PKT_BURST)\n+\t\tenq_len = MAX_PKT_BURST;\n+\n+\t/* See if it's single link */\n+\tif (lcore_nb_link == 1)\n+\t\tgoto single_link_loop;\n+\telse\n+\t\tgoto multi_link_loop;\n+\n+single_link_loop:\n+\n+\tRTE_LOG(INFO, L2FWD, \" -- lcoreid=%u event_port_id=%u\\n\", lcore_id,\n+\t\tlinks[0].event_portid);\n+\n+\twhile (!force_quit) {\n+\n+\t\t/* Do periodic operations (buffer drain & stats monitor) */\n+\t\tl2fwd_periodic_drain_stats_monitor(qconf, &tsc, is_master_core);\n+\n+\t\t/* Read packet from event queues */\n+\t\tnb_rx = rte_event_dequeue_burst(links[0].eventdev_id,\n+\t\t\t\tlinks[0].event_portid,\n+\t\t\t\tev, /* events */\n+\t\t\t\tdeq_len, /* nb_events */\n+\t\t\t\t0 /* timeout_ticks */);\n+\n+\t\tif (nb_rx == 0)\n+\t\t\tcontinue;\n+\n+\t\tfor (j = 0; j < nb_rx; j++) {\n+\n+\t\t\tportid = ev[j].queue_id;\n+\t\t\tport_statistics[portid].rx++;\n+\t\t\tpkt = ev[j].mbuf;\n+\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkt, void *));\n+\n+\t\t\t/* Process packet */\n+\t\t\tl2fwd_event_pre_forward(&(ev[j]), portid);\n+\n+\t\t\t/*\n+\t\t\t * Internal port is not available, the packet needs\n+\t\t\t * to be enqueued to the designated event queue.\n+\t\t\t */\n+\n+\t\t\t/* Prepare event for submission to tx event queue */\n+\t\t\tl2fwd_event_switch_to_tx_queue(&(ev[j]), tx_queue);\n+\t\t}\n+\n+\t\tfor (j = 0, left = nb_rx;\n+\t\t\tj < (nb_rx + enq_len - 1)/enq_len; j++) {\n+\n+\t\t\t/* Submit the updated events for tx stage */\n+\t\t\tleft -= rte_event_enqueue_burst(links[0].eventdev_id,\n+\t\t\t\t\tlinks[0].event_portid,\n+\t\t\t\t\t&(ev[j*enq_len]), /* events */\n+\t\t\t\t\tleft > enq_len ?\n+\t\t\t\t\tenq_len : left /* nb_events */);\n+\t\t}\n+\t}\n+\tgoto clean_and_exit;\n+\n+multi_link_loop:\n+\n+\tfor (i = 0; i < lcore_nb_link; i++) {\n+\t\tRTE_LOG(INFO, L2FWD, \" -- lcoreid=%u event_port_id=%u\\n\",\n+\t\t\tlcore_id, links[i].event_portid);\n+\t}\n+\n+\twhile (!force_quit) {\n+\n+\t\t/* Do periodic operations (buffer drain & stats monitor) */\n+\t\tl2fwd_periodic_drain_stats_monitor(qconf, &tsc, is_master_core);\n+\n+\t\tfor (i = 0; i < lcore_nb_link; i++) {\n+\t\t\t/* Read packet from event queues */\n+\t\t\tnb_rx = rte_event_dequeue_burst(links[i].eventdev_id,\n+\t\t\t\t\tlinks[i].event_portid,\n+\t\t\t\t\tev, /* events */\n+\t\t\t\t\tdeq_len, /* nb_events */\n+\t\t\t\t\t0 /* timeout_ticks */);\n+\n+\t\t\tif (nb_rx == 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tfor (j = 0; j < nb_rx; j++) {\n+\n+\t\t\t\tportid = ev[j].queue_id;\n+\t\t\t\tport_statistics[portid].rx++;\n+\t\t\t\tpkt = ev[j].mbuf;\n+\n+\t\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkt, void *));\n+\n+\t\t\t\t/* Process packet */\n+\t\t\t\tl2fwd_event_pre_forward(&(ev[j]), portid);\n+\n+\t\t\t\t/*\n+\t\t\t\t * Internal port is not available, the packet\n+\t\t\t\t * needs to be enqueued to the designated event\n+\t\t\t\t * queue.\n+\t\t\t\t */\n+\n+\t\t\t\t/* Update the scheduling type for tx stage */\n+\t\t\t\tl2fwd_event_switch_to_tx_queue(&(ev[j]),\n+\t\t\t\t\t\ttx_queue);\n+\t\t\t}\n+\n+\t\t\tfor (j = 0, left = nb_rx;\n+\t\t\t\tj < (nb_rx + enq_len - 1)/enq_len; j++) {\n+\n+\t\t\t\t/* Submit the updated events for tx stage */\n+\t\t\t\tleft -= rte_event_enqueue_burst(\n+\t\t\t\t\tlinks[i].eventdev_id,\n+\t\t\t\t\tlinks[i].event_portid,\n+\t\t\t\t\t&(ev[j*enq_len]), /* events */\n+\t\t\t\t\tleft > enq_len ?\n+\t\t\t\t\tenq_len : left /* nb_events */);\n+\t\t\t}\n+\t\t}\n+\t}\n+\tgoto clean_and_exit;\n+\n+clean_and_exit:\n+\tif (links != NULL)\n+\t\trte_free(links);\n+}\n+\n static uint8_t\n l2fwd_eventmode_populate_wrkr_params(\n \t\tstruct rte_eventmode_helper_app_worker_params *wrkrs)\n@@ -665,6 +873,15 @@ l2fwd_eventmode_populate_wrkr_params(\n \twrkr->worker_thread = l2fwd_eventmode_non_burst_tx_internal_port;\n \n \tnb_wrkr_param++;\n+\twrkr++;\n+\n+\t/* Burst no internal port (regular tx worker) */\n+\twrkr->cap.burst = RTE_EVENTMODE_HELPER_RX_TYPE_BURST;\n+\twrkr->cap.tx_internal_port =\n+\t\t\tRTE_EVENTMODE_HELPER_TX_TYPE_NO_INTERNAL_PORT;\n+\twrkr->worker_thread = l2fwd_eventmode_burst_no_internal_port;\n+\n+\tnb_wrkr_param++;\n \treturn nb_wrkr_param;\n }\n \n", "prefixes": [ "38/39" ] }{ "id": 54263, "url": "