Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41706/?format=api
http://patchwork.dpdk.org/api/patches/41706/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180627163123.135686-12-jasvinder.singh@intel.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": "<20180627163123.135686-12-jasvinder.singh@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180627163123.135686-12-jasvinder.singh@intel.com", "date": "2018-06-27T16:31:11", "name": "[v3,11/23] net/softnic: add softnic run API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "dd0f5ae8de446ab90a8a5b285bfc4d7f2513306b", "submitter": { "id": 285, "url": "http://patchwork.dpdk.org/api/people/285/?format=api", "name": "Jasvinder Singh", "email": "jasvinder.singh@intel.com" }, "delegate": { "id": 10018, "url": "http://patchwork.dpdk.org/api/users/10018/?format=api", "username": "cristian_dumitrescu", "first_name": "Cristian", "last_name": "Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180627163123.135686-12-jasvinder.singh@intel.com/mbox/", "series": [ { "id": 270, "url": "http://patchwork.dpdk.org/api/series/270/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=270", "date": "2018-06-27T16:31:01", "name": "[v3,01/23] net/softnic: restructuring", "version": 3, "mbox": "http://patchwork.dpdk.org/series/270/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41706/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41706/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 9338B1C1B9;\n\tWed, 27 Jun 2018 18:32:05 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id AFEC01C124\n\tfor <dev@dpdk.org>; Wed, 27 Jun 2018 18:31:40 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Jun 2018 09:31:39 -0700", "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby fmsmga005.fm.intel.com with ESMTP; 27 Jun 2018 09:31:38 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,279,1526367600\"; d=\"scan'208\";a=\"240789669\"", "From": "Jasvinder Singh <jasvinder.singh@intel.com>", "To": "dev@dpdk.org", "Cc": "cristian.dumitrescu@intel.com,\n\tbernard.iremonger@intel.com", "Date": "Wed, 27 Jun 2018 17:31:11 +0100", "Message-Id": "<20180627163123.135686-12-jasvinder.singh@intel.com>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20180627163123.135686-1-jasvinder.singh@intel.com>", "References": "<20180615165224.25004-2-jasvinder.singh@intel.com>\n\t<20180627163123.135686-1-jasvinder.singh@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 11/23] net/softnic: add softnic run API", "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": "Implements softnic API function to run pipeline objects.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic.c | 13 --\n drivers/net/softnic/rte_eth_softnic_thread.c | 195 +++++++++++++++++++++++++++\n 2 files changed, 195 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex a2782d7..aed3acd 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -206,19 +206,6 @@ pmd_tx_pkt_burst(void *txq,\n \t\tNULL);\n }\n \n-int\n-rte_pmd_softnic_run(uint16_t port_id)\n-{\n-\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n-\n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n-#endif\n-\n-\tdev = dev;\n-\treturn 0;\n-}\n-\n static void *\n pmd_init(struct pmd_params *params)\n {\ndiff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c\nindex 4da1383..e8c4916 100644\n--- a/drivers/net/softnic/rte_eth_softnic_thread.c\n+++ b/drivers/net/softnic/rte_eth_softnic_thread.c\n@@ -88,3 +88,198 @@ thread_init(struct pmd_internals *softnic)\n \n \treturn 0;\n }\n+\n+/**\n+ * Master thread & data plane threads: message passing\n+ */\n+enum thread_req_type {\n+\tTHREAD_REQ_MAX\n+};\n+\n+struct thread_msg_req {\n+\tenum thread_req_type type;\n+};\n+\n+struct thread_msg_rsp {\n+\tint status;\n+};\n+\n+/**\n+ * Data plane threads: message handling\n+ */\n+static inline struct thread_msg_req *\n+thread_msg_recv(struct rte_ring *msgq_req)\n+{\n+\tstruct thread_msg_req *req;\n+\n+\tint status = rte_ring_sc_dequeue(msgq_req, (void **)&req);\n+\n+\tif (status != 0)\n+\t\treturn NULL;\n+\n+\treturn req;\n+}\n+\n+static inline void\n+thread_msg_send(struct rte_ring *msgq_rsp,\n+\tstruct thread_msg_rsp *rsp)\n+{\n+\tint status;\n+\n+\tdo {\n+\t\tstatus = rte_ring_sp_enqueue(msgq_rsp, rsp);\n+\t} while (status == -ENOBUFS);\n+}\n+\n+static void\n+thread_msg_handle(struct thread_data *t)\n+{\n+\tfor ( ; ; ) {\n+\t\tstruct thread_msg_req *req;\n+\t\tstruct thread_msg_rsp *rsp;\n+\n+\t\treq = thread_msg_recv(t->msgq_req);\n+\t\tif (req == NULL)\n+\t\t\tbreak;\n+\n+\t\tswitch (req->type) {\n+\t\tdefault:\n+\t\t\trsp = (struct thread_msg_rsp *)req;\n+\t\t\trsp->status = -1;\n+\t\t}\n+\n+\t\tthread_msg_send(t->msgq_rsp, rsp);\n+\t}\n+}\n+\n+/**\n+ * Master thread & data plane threads: message passing\n+ */\n+enum pipeline_req_type {\n+\tPIPELINE_REQ_MAX\n+};\n+\n+struct pipeline_msg_req {\n+\tenum pipeline_req_type type;\n+};\n+\n+struct pipeline_msg_rsp {\n+\tint status;\n+};\n+\n+/**\n+ * Data plane threads: message handling\n+ */\n+static inline struct pipeline_msg_req *\n+pipeline_msg_recv(struct rte_ring *msgq_req)\n+{\n+\tstruct pipeline_msg_req *req;\n+\n+\tint status = rte_ring_sc_dequeue(msgq_req, (void **)&req);\n+\n+\tif (status != 0)\n+\t\treturn NULL;\n+\n+\treturn req;\n+}\n+\n+static inline void\n+pipeline_msg_send(struct rte_ring *msgq_rsp,\n+\tstruct pipeline_msg_rsp *rsp)\n+{\n+\tint status;\n+\n+\tdo {\n+\t\tstatus = rte_ring_sp_enqueue(msgq_rsp, rsp);\n+\t} while (status == -ENOBUFS);\n+}\n+\n+static void\n+pipeline_msg_handle(struct pipeline_data *p)\n+{\n+\tfor ( ; ; ) {\n+\t\tstruct pipeline_msg_req *req;\n+\t\tstruct pipeline_msg_rsp *rsp;\n+\n+\t\treq = pipeline_msg_recv(p->msgq_req);\n+\t\tif (req == NULL)\n+\t\t\tbreak;\n+\n+\t\tswitch (req->type) {\n+\t\tdefault:\n+\t\t\trsp = (struct pipeline_msg_rsp *)req;\n+\t\t\trsp->status = -1;\n+\t\t}\n+\n+\t\tpipeline_msg_send(p->msgq_rsp, rsp);\n+\t}\n+}\n+\n+/**\n+ * Data plane threads: main\n+ */\n+int\n+rte_pmd_softnic_run(uint16_t port_id)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\tstruct pmd_internals *softnic;\n+\tstruct thread_data *t;\n+\tuint32_t thread_id, j;\n+\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n+#endif\n+\n+\tsoftnic = dev->data->dev_private;\n+\tthread_id = rte_lcore_id();\n+\tt = &softnic->thread_data[thread_id];\n+\tt->iter++;\n+\n+\t/* Data Plane */\n+\tfor (j = 0; j < t->n_pipelines; j++)\n+\t\trte_pipeline_run(t->p[j]);\n+\n+\t/* Control Plane */\n+\tif ((t->iter & 0xFLLU) == 0) {\n+\t\tuint64_t time = rte_get_tsc_cycles();\n+\t\tuint64_t time_next_min = UINT64_MAX;\n+\n+\t\tif (time < t->time_next_min)\n+\t\t\treturn 0;\n+\n+\t\t/* Pipeline message queues */\n+\t\tfor (j = 0; j < t->n_pipelines; j++) {\n+\t\t\tstruct pipeline_data *p =\n+\t\t\t\t&t->pipeline_data[j];\n+\t\t\tuint64_t time_next = p->time_next;\n+\n+\t\t\tif (time_next <= time) {\n+\t\t\t\tpipeline_msg_handle(p);\n+\t\t\t\trte_pipeline_flush(p->p);\n+\t\t\t\ttime_next = time + p->timer_period;\n+\t\t\t\tp->time_next = time_next;\n+\t\t\t}\n+\n+\t\t\tif (time_next < time_next_min)\n+\t\t\t\ttime_next_min = time_next;\n+\t\t}\n+\n+\t\t/* Thread message queues */\n+\t\t{\n+\t\t\tuint64_t time_next = t->time_next;\n+\n+\t\t\tif (time_next <= time) {\n+\t\t\t\tthread_msg_handle(t);\n+\t\t\t\ttime_next = time + t->timer_period;\n+\t\t\t\tt->time_next = time_next;\n+\t\t\t}\n+\n+\t\t\tif (time_next < time_next_min)\n+\t\t\t\ttime_next_min = time_next;\n+\t\t}\n+\n+\t\tt->time_next_min = time_next_min;\n+\t}\n+\n+\treturn 0;\n+}\n", "prefixes": [ "v3", "11/23" ] }{ "id": 41706, "url": "