Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/98612/?format=api
http://patches.dpdk.org/api/patches/98612/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210910123003.85448-4-cristian.dumitrescu@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": "<20210910123003.85448-4-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210910123003.85448-4-cristian.dumitrescu@intel.com", "date": "2021-09-10T12:29:43", "name": "[04/24] pipeline: create inline functions for TX instruction", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5e6e2b4626e954b64ddb628963528cc69565f511", "submitter": { "id": 19, "url": "http://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210910123003.85448-4-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 18838, "url": "http://patches.dpdk.org/api/series/18838/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18838", "date": "2021-09-10T12:29:44", "name": "[01/24] pipeline: move data structures to internal header file", "version": 1, "mbox": "http://patches.dpdk.org/series/18838/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/98612/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/98612/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 82422A0547;\n\tFri, 10 Sep 2021 14:31:34 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0CBAB41172;\n\tFri, 10 Sep 2021 14:30:34 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id E10B0410EB\n for <dev@dpdk.org>; Fri, 10 Sep 2021 14:30:22 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Sep 2021 05:30:08 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga001.jf.intel.com with ESMTP; 10 Sep 2021 05:30:07 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10102\"; a=\"243386255\"", "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"243386255\"", "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"514279703\"" ], "X-ExtLoop1": "1", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 10 Sep 2021 13:29:43 +0100", "Message-Id": "<20210910123003.85448-4-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210910123003.85448-1-cristian.dumitrescu@intel.com>", "References": "<20210910123003.85448-1-cristian.dumitrescu@intel.com>", "Subject": "[dpdk-dev] [PATCH 04/24] pipeline: create inline functions for TX\n instruction", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/pipeline/rte_swx_pipeline.c | 86 +---------------------\n lib/pipeline/rte_swx_pipeline_internal.h | 90 ++++++++++++++++++++++++\n 2 files changed, 92 insertions(+), 84 deletions(-)", "diff": "diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex ad1ecfc640..bcf796f8c3 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -1567,84 +1567,13 @@ instr_drop_translate(struct rte_swx_pipeline *p,\n \treturn 0;\n }\n \n-static inline void\n-emit_handler(struct thread *t)\n-{\n-\tstruct header_out_runtime *h0 = &t->headers_out[0];\n-\tstruct header_out_runtime *h1 = &t->headers_out[1];\n-\tuint32_t offset = 0, i;\n-\n-\t/* No header change or header decapsulation. */\n-\tif ((t->n_headers_out == 1) &&\n-\t (h0->ptr + h0->n_bytes == t->ptr)) {\n-\t\tTRACE(\"Emit handler: no header change or header decap.\\n\");\n-\n-\t\tt->pkt.offset -= h0->n_bytes;\n-\t\tt->pkt.length += h0->n_bytes;\n-\n-\t\treturn;\n-\t}\n-\n-\t/* Header encapsulation (optionally, with prior header decasulation). */\n-\tif ((t->n_headers_out == 2) &&\n-\t (h1->ptr + h1->n_bytes == t->ptr) &&\n-\t (h0->ptr == h0->ptr0)) {\n-\t\tuint32_t offset;\n-\n-\t\tTRACE(\"Emit handler: header encapsulation.\\n\");\n-\n-\t\toffset = h0->n_bytes + h1->n_bytes;\n-\t\tmemcpy(t->ptr - offset, h0->ptr, h0->n_bytes);\n-\t\tt->pkt.offset -= offset;\n-\t\tt->pkt.length += offset;\n-\n-\t\treturn;\n-\t}\n-\n-\t/* Header insertion. */\n-\t/* TBD */\n-\n-\t/* Header extraction. */\n-\t/* TBD */\n-\n-\t/* For any other case. */\n-\tTRACE(\"Emit handler: complex case.\\n\");\n-\n-\tfor (i = 0; i < t->n_headers_out; i++) {\n-\t\tstruct header_out_runtime *h = &t->headers_out[i];\n-\n-\t\tmemcpy(&t->header_out_storage[offset], h->ptr, h->n_bytes);\n-\t\toffset += h->n_bytes;\n-\t}\n-\n-\tif (offset) {\n-\t\tmemcpy(t->ptr - offset, t->header_out_storage, offset);\n-\t\tt->pkt.offset -= offset;\n-\t\tt->pkt.length += offset;\n-\t}\n-}\n-\n-static inline void\n-instr_tx_exec(struct rte_swx_pipeline *p);\n-\n static inline void\n instr_tx_exec(struct rte_swx_pipeline *p)\n {\n \tstruct thread *t = &p->threads[p->thread_id];\n \tstruct instruction *ip = t->ip;\n-\tuint64_t port_id = METADATA_READ(t, ip->io.io.offset, ip->io.io.n_bits);\n-\tstruct port_out_runtime *port = &p->out[port_id];\n-\tstruct rte_swx_pkt *pkt = &t->pkt;\n \n-\tTRACE(\"[Thread %2u]: tx 1 pkt to port %u\\n\",\n-\t p->thread_id,\n-\t (uint32_t)port_id);\n-\n-\t/* Headers. */\n-\temit_handler(t);\n-\n-\t/* Packet. */\n-\tport->pkt_tx(port->obj, pkt);\n+\t__instr_tx_exec(p, t, ip);\n \n \t/* Thread. */\n \tthread_ip_reset(p, t);\n@@ -1656,19 +1585,8 @@ instr_tx_i_exec(struct rte_swx_pipeline *p)\n {\n \tstruct thread *t = &p->threads[p->thread_id];\n \tstruct instruction *ip = t->ip;\n-\tuint64_t port_id = ip->io.io.val;\n-\tstruct port_out_runtime *port = &p->out[port_id];\n-\tstruct rte_swx_pkt *pkt = &t->pkt;\n-\n-\tTRACE(\"[Thread %2u]: tx (i) 1 pkt to port %u\\n\",\n-\t p->thread_id,\n-\t (uint32_t)port_id);\n-\n-\t/* Headers. */\n-\temit_handler(t);\n \n-\t/* Packet. */\n-\tport->pkt_tx(port->obj, pkt);\n+\t__instr_tx_i_exec(p, t, ip);\n \n \t/* Thread. */\n \tthread_ip_reset(p, t);\ndiff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h\nindex 9814b5685a..e9fe6632b6 100644\n--- a/lib/pipeline/rte_swx_pipeline_internal.h\n+++ b/lib/pipeline/rte_swx_pipeline_internal.h\n@@ -1490,4 +1490,94 @@ instr_rx_exec(struct rte_swx_pipeline *p)\n \tthread_yield(p);\n }\n \n+/*\n+ * tx.\n+ */\n+static inline void\n+emit_handler(struct thread *t)\n+{\n+\tstruct header_out_runtime *h0 = &t->headers_out[0];\n+\tstruct header_out_runtime *h1 = &t->headers_out[1];\n+\tuint32_t offset = 0, i;\n+\n+\t/* No header change or header decapsulation. */\n+\tif ((t->n_headers_out == 1) &&\n+\t (h0->ptr + h0->n_bytes == t->ptr)) {\n+\t\tTRACE(\"Emit handler: no header change or header decap.\\n\");\n+\n+\t\tt->pkt.offset -= h0->n_bytes;\n+\t\tt->pkt.length += h0->n_bytes;\n+\n+\t\treturn;\n+\t}\n+\n+\t/* Header encapsulation (optionally, with prior header decasulation). */\n+\tif ((t->n_headers_out == 2) &&\n+\t (h1->ptr + h1->n_bytes == t->ptr) &&\n+\t (h0->ptr == h0->ptr0)) {\n+\t\tuint32_t offset;\n+\n+\t\tTRACE(\"Emit handler: header encapsulation.\\n\");\n+\n+\t\toffset = h0->n_bytes + h1->n_bytes;\n+\t\tmemcpy(t->ptr - offset, h0->ptr, h0->n_bytes);\n+\t\tt->pkt.offset -= offset;\n+\t\tt->pkt.length += offset;\n+\n+\t\treturn;\n+\t}\n+\n+\t/* For any other case. */\n+\tTRACE(\"Emit handler: complex case.\\n\");\n+\n+\tfor (i = 0; i < t->n_headers_out; i++) {\n+\t\tstruct header_out_runtime *h = &t->headers_out[i];\n+\n+\t\tmemcpy(&t->header_out_storage[offset], h->ptr, h->n_bytes);\n+\t\toffset += h->n_bytes;\n+\t}\n+\n+\tif (offset) {\n+\t\tmemcpy(t->ptr - offset, t->header_out_storage, offset);\n+\t\tt->pkt.offset -= offset;\n+\t\tt->pkt.length += offset;\n+\t}\n+}\n+\n+static inline void\n+__instr_tx_exec(struct rte_swx_pipeline *p, struct thread *t, const struct instruction *ip)\n+{\n+\tuint64_t port_id = METADATA_READ(t, ip->io.io.offset, ip->io.io.n_bits);\n+\tstruct port_out_runtime *port = &p->out[port_id];\n+\tstruct rte_swx_pkt *pkt = &t->pkt;\n+\n+\tTRACE(\"[Thread %2u]: tx 1 pkt to port %u\\n\",\n+\t p->thread_id,\n+\t (uint32_t)port_id);\n+\n+\t/* Headers. */\n+\temit_handler(t);\n+\n+\t/* Packet. */\n+\tport->pkt_tx(port->obj, pkt);\n+}\n+\n+static inline void\n+__instr_tx_i_exec(struct rte_swx_pipeline *p, struct thread *t, const struct instruction *ip)\n+{\n+\tuint64_t port_id = ip->io.io.val;\n+\tstruct port_out_runtime *port = &p->out[port_id];\n+\tstruct rte_swx_pkt *pkt = &t->pkt;\n+\n+\tTRACE(\"[Thread %2u]: tx (i) 1 pkt to port %u\\n\",\n+\t p->thread_id,\n+\t (uint32_t)port_id);\n+\n+\t/* Headers. */\n+\temit_handler(t);\n+\n+\t/* Packet. */\n+\tport->pkt_tx(port->obj, pkt);\n+}\n+\n #endif\n", "prefixes": [ "04/24" ] }{ "id": 98612, "url": "