Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/40837/?format=api
http://patches.dpdk.org/api/patches/40837/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180608124155.140663-12-jasvinder.singh@intel.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": "<20180608124155.140663-12-jasvinder.singh@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180608124155.140663-12-jasvinder.singh@intel.com", "date": "2018-06-08T12:41:45", "name": "[dpdk-dev,11/21] net/softnic: add softnic run API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cf42b67d2a66ed8ade75ac46a859a2bb544c76e4", "submitter": { "id": 285, "url": "http://patches.dpdk.org/api/people/285/?format=api", "name": "Jasvinder Singh", "email": "jasvinder.singh@intel.com" }, "delegate": { "id": 10018, "url": "http://patches.dpdk.org/api/users/10018/?format=api", "username": "cristian_dumitrescu", "first_name": "Cristian", "last_name": "Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180608124155.140663-12-jasvinder.singh@intel.com/mbox/", "series": [ { "id": 52, "url": "http://patches.dpdk.org/api/series/52/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=52", "date": "2018-06-08T12:41:35", "name": "[dpdk-dev,01/21] net/softnic: restructuring", "version": 1, "mbox": "http://patches.dpdk.org/series/52/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/40837/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/40837/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 E7A497CC5;\n\tFri, 8 Jun 2018 14:42:31 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id A50FB5F54\n\tfor <dev@dpdk.org>; Fri, 8 Jun 2018 14:42:08 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Jun 2018 05:42:08 -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; 08 Jun 2018 05:42:07 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.49,490,1520924400\"; d=\"scan'208\";a=\"235505357\"", "From": "Jasvinder Singh <jasvinder.singh@intel.com>", "To": "dev@dpdk.org", "Cc": "cristian.dumitrescu@intel.com", "Date": "Fri, 8 Jun 2018 13:41:45 +0100", "Message-Id": "<20180608124155.140663-12-jasvinder.singh@intel.com>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20180608124155.140663-1-jasvinder.singh@intel.com>", "References": "<20180608124155.140663-1-jasvinder.singh@intel.com>", "Subject": "[dpdk-dev] [PATCH 11/21] 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://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": "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 f4bd3f3..321813b 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -193,19 +193,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..3a994bc 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": [ "dpdk-dev", "11/21" ] }{ "id": 40837, "url": "