Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/78593/?format=api
https://patches.dpdk.org/api/patches/78593/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200923180645.55852-12-cristian.dumitrescu@intel.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": "<20200923180645.55852-12-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200923180645.55852-12-cristian.dumitrescu@intel.com", "date": "2020-09-23T18:06:15", "name": "[v5,11/41] pipeline: add header validate and invalidate SWX instructions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "fa24f4504ac445ddbf26cbc6733f7efb297869aa", "submitter": { "id": 19, "url": "https://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200923180645.55852-12-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 12446, "url": "https://patches.dpdk.org/api/series/12446/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12446", "date": "2020-09-23T18:06:05", "name": "Pipeline alignment with the P4 language", "version": 5, "mbox": "https://patches.dpdk.org/series/12446/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/78593/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/78593/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2A397A04B1;\n\tWed, 23 Sep 2020 20:08:47 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CDD671DC7C;\n\tWed, 23 Sep 2020 20:07:21 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id C656F1DAB1\n for <dev@dpdk.org>; Wed, 23 Sep 2020 20:07:01 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Sep 2020 11:07:01 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga003.jf.intel.com with ESMTP; 23 Sep 2020 11:07:00 -0700" ], "IronPort-SDR": [ "\n KkthAGyjV9oxeLmwAnHXAVdAIbO7GVkvNd0EcBaBf9b7iPvLNho+t7WNDvsAYAhwtD/8JvsRYl\n +u8sJBPlhHfg==", "\n fIs6+ZZOP91ZWB2kV389wyMc+6W5ZXhrnkkv0q0CsxUtcZkiX1bcOp+VJKyNgdxxXGcDKWeCLZ\n +jWpv0IVGqyA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9753\"; a=\"245809520\"", "E=Sophos;i=\"5.77,293,1596524400\"; d=\"scan'208\";a=\"245809520\"", "E=Sophos;i=\"5.77,293,1596524400\"; d=\"scan'208\";a=\"305477857\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net,\n\tdavid.marchand@redhat.com", "Date": "Wed, 23 Sep 2020 19:06:15 +0100", "Message-Id": "<20200923180645.55852-12-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200923180645.55852-1-cristian.dumitrescu@intel.com>", "References": "<20200910152645.9342-2-cristian.dumitrescu@intel.com>\n <20200923180645.55852-1-cristian.dumitrescu@intel.com>", "Subject": "[dpdk-dev] [PATCH v5 11/41] pipeline: add header validate and\n\tinvalidate SWX instructions", "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 <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": "Add instructions to flag a header as valid or invalid. This flag can\nbe tested by the jmpv (jump if header valid) and jmpnv (jump if header\nnot valid) instructions.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_pipeline/rte_swx_pipeline.c | 108 +++++++++++++++++++++++++\n 1 file changed, 108 insertions(+)", "diff": "diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c\nindex 19bf2761d..8ddd766c2 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.c\n+++ b/lib/librte_pipeline/rte_swx_pipeline.c\n@@ -236,6 +236,12 @@ enum instruction_type {\n \tINSTR_HDR_EMIT6_TX,\n \tINSTR_HDR_EMIT7_TX,\n \tINSTR_HDR_EMIT8_TX,\n+\n+\t/* validate h.header */\n+\tINSTR_HDR_VALIDATE,\n+\n+\t/* invalidate h.header */\n+\tINSTR_HDR_INVALIDATE,\n };\n \n struct instr_io {\n@@ -252,10 +258,15 @@ struct instr_io {\n \t} hdr;\n };\n \n+struct instr_hdr_validity {\n+\tuint8_t header_id;\n+};\n+\n struct instruction {\n \tenum instruction_type type;\n \tunion {\n \t\tstruct instr_io io;\n+\t\tstruct instr_hdr_validity valid;\n \t};\n };\n \n@@ -2098,6 +2109,84 @@ instr_hdr_emit8_tx_exec(struct rte_swx_pipeline *p)\n \tinstr_tx_exec(p);\n }\n \n+/*\n+ * validate.\n+ */\n+static int\n+instr_hdr_validate_translate(struct rte_swx_pipeline *p,\n+\t\t\t struct action *action __rte_unused,\n+\t\t\t char **tokens,\n+\t\t\t int n_tokens,\n+\t\t\t struct instruction *instr,\n+\t\t\t struct instruction_data *data __rte_unused)\n+{\n+\tstruct header *h;\n+\n+\tCHECK(n_tokens == 2, EINVAL);\n+\n+\th = header_parse(p, tokens[1]);\n+\tCHECK(h, EINVAL);\n+\n+\tinstr->type = INSTR_HDR_VALIDATE;\n+\tinstr->valid.header_id = h->id;\n+\treturn 0;\n+}\n+\n+static inline void\n+instr_hdr_validate_exec(struct rte_swx_pipeline *p)\n+{\n+\tstruct thread *t = &p->threads[p->thread_id];\n+\tstruct instruction *ip = t->ip;\n+\tuint32_t header_id = ip->valid.header_id;\n+\n+\tTRACE(\"[Thread %2u] validate header %u\\n\", p->thread_id, header_id);\n+\n+\t/* Headers. */\n+\tt->valid_headers = MASK64_BIT_SET(t->valid_headers, header_id);\n+\n+\t/* Thread. */\n+\tthread_ip_inc(p);\n+}\n+\n+/*\n+ * invalidate.\n+ */\n+static int\n+instr_hdr_invalidate_translate(struct rte_swx_pipeline *p,\n+\t\t\t struct action *action __rte_unused,\n+\t\t\t char **tokens,\n+\t\t\t int n_tokens,\n+\t\t\t struct instruction *instr,\n+\t\t\t struct instruction_data *data __rte_unused)\n+{\n+\tstruct header *h;\n+\n+\tCHECK(n_tokens == 2, EINVAL);\n+\n+\th = header_parse(p, tokens[1]);\n+\tCHECK(h, EINVAL);\n+\n+\tinstr->type = INSTR_HDR_INVALIDATE;\n+\tinstr->valid.header_id = h->id;\n+\treturn 0;\n+}\n+\n+static inline void\n+instr_hdr_invalidate_exec(struct rte_swx_pipeline *p)\n+{\n+\tstruct thread *t = &p->threads[p->thread_id];\n+\tstruct instruction *ip = t->ip;\n+\tuint32_t header_id = ip->valid.header_id;\n+\n+\tTRACE(\"[Thread %2u] invalidate header %u\\n\", p->thread_id, header_id);\n+\n+\t/* Headers. */\n+\tt->valid_headers = MASK64_BIT_CLR(t->valid_headers, header_id);\n+\n+\t/* Thread. */\n+\tthread_ip_inc(p);\n+}\n+\n #define RTE_SWX_INSTRUCTION_TOKENS_MAX 16\n \n static int\n@@ -2167,6 +2256,22 @@ instr_translate(struct rte_swx_pipeline *p,\n \t\t\t\t\t\tinstr,\n \t\t\t\t\t\tdata);\n \n+\tif (!strcmp(tokens[tpos], \"validate\"))\n+\t\treturn instr_hdr_validate_translate(p,\n+\t\t\t\t\t\t action,\n+\t\t\t\t\t\t &tokens[tpos],\n+\t\t\t\t\t\t n_tokens - tpos,\n+\t\t\t\t\t\t instr,\n+\t\t\t\t\t\t data);\n+\n+\tif (!strcmp(tokens[tpos], \"invalidate\"))\n+\t\treturn instr_hdr_invalidate_translate(p,\n+\t\t\t\t\t\t action,\n+\t\t\t\t\t\t &tokens[tpos],\n+\t\t\t\t\t\t n_tokens - tpos,\n+\t\t\t\t\t\t instr,\n+\t\t\t\t\t\t data);\n+\n \tCHECK(0, EINVAL);\n }\n \n@@ -2308,6 +2413,9 @@ static instr_exec_t instruction_table[] = {\n \t[INSTR_HDR_EMIT6_TX] = instr_hdr_emit6_tx_exec,\n \t[INSTR_HDR_EMIT7_TX] = instr_hdr_emit7_tx_exec,\n \t[INSTR_HDR_EMIT8_TX] = instr_hdr_emit8_tx_exec,\n+\n+\t[INSTR_HDR_VALIDATE] = instr_hdr_validate_exec,\n+\t[INSTR_HDR_INVALIDATE] = instr_hdr_invalidate_exec,\n };\n \n static inline void\n", "prefixes": [ "v5", "11/41" ] }{ "id": 78593, "url": "