Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/76748/?format=api
https://patches.dpdk.org/api/patches/76748/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200907214032.95052-9-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": "<20200907214032.95052-9-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200907214032.95052-9-cristian.dumitrescu@intel.com", "date": "2020-09-07T21:39:59", "name": "[v2,08/41] pipeline: add SWX pipeline instructions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "17e93fd5330b3cdc7354a3aacea64d7c4ad48a2e", "submitter": { "id": 19, "url": "https://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200907214032.95052-9-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 11999, "url": "https://patches.dpdk.org/api/series/11999/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11999", "date": "2020-09-07T21:39:51", "name": "Pipeline alignment with the P4 language", "version": 2, "mbox": "https://patches.dpdk.org/series/11999/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/76748/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/76748/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 B8572A04AA;\n\tMon, 7 Sep 2020 23:42:03 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4A55F1C136;\n\tMon, 7 Sep 2020 23:40:49 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id 707F81C112\n for <dev@dpdk.org>; Mon, 7 Sep 2020 23:40:42 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Sep 2020 14:40:42 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga002.fm.intel.com with ESMTP; 07 Sep 2020 14:40:41 -0700" ], "IronPort-SDR": [ "\n 65hDROrXvCuO4Von9lCGa7u940q39ehPcK/ztoskKzL8UJ6CQN5Mq3b/1576FSiVUIednAHxbP\n T6+s6wWJQqaA==", "\n o1S4SjXb221fJ6kW8ZTrVuyKfq25BRQ8FgXJTZqxhBFjAI9+Uam0PfWG9b7RZPhTx0LHBrOp1O\n M99eTCCez9BA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9737\"; a=\"176099051\"", "E=Sophos;i=\"5.76,403,1592895600\"; d=\"scan'208\";a=\"176099051\"", "E=Sophos;i=\"5.76,403,1592895600\"; d=\"scan'208\";a=\"336190147\"" ], "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", "Date": "Mon, 7 Sep 2020 22:39:59 +0100", "Message-Id": "<20200907214032.95052-9-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200907214032.95052-1-cristian.dumitrescu@intel.com>", "References": "<20200826151445.51500-2-cristian.dumitrescu@intel.com>\n <20200907214032.95052-1-cristian.dumitrescu@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 08/41] pipeline: add SWX pipeline 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": "The SWX pipeline instructions represent the main program that defines\nthe life of the packet. As packets go through tables that trigger\naction subroutines, the headers and meta-data get transformed along\nthe way.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_pipeline/rte_pipeline_version.map | 1 +\n lib/librte_pipeline/rte_swx_pipeline.c | 36 ++++++++++++++++++++\n lib/librte_pipeline/rte_swx_pipeline.h | 20 +++++++++++\n 3 files changed, 57 insertions(+)", "diff": "diff --git a/lib/librte_pipeline/rte_pipeline_version.map b/lib/librte_pipeline/rte_pipeline_version.map\nindex b9e59bce2..7139df0d3 100644\n--- a/lib/librte_pipeline/rte_pipeline_version.map\n+++ b/lib/librte_pipeline/rte_pipeline_version.map\n@@ -70,6 +70,7 @@ EXPERIMENTAL {\n \trte_swx_pipeline_action_config;\n \trte_swx_pipeline_table_type_register;\n \trte_swx_pipeline_table_config;\n+\trte_swx_pipeline_instructions_config;\n \trte_swx_pipeline_build;\n \trte_swx_pipeline_free;\n \trte_swx_pipeline_table_state_get;\ndiff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c\nindex eb5b327e8..2ae6229d0 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.c\n+++ b/lib/librte_pipeline/rte_swx_pipeline.c\n@@ -274,6 +274,10 @@ struct thread {\n \t/* Extern objects and functions. */\n \tstruct extern_obj_runtime *extern_objs;\n \tstruct extern_func_runtime *extern_funcs;\n+\n+\t/* Instructions. */\n+\tstruct instruction *ip;\n+\tstruct instruction *ret;\n };\n \n #ifndef RTE_SWX_PIPELINE_THREADS_MAX\n@@ -300,6 +304,7 @@ struct rte_swx_pipeline {\n \tstruct port_out_runtime *out;\n \tstruct instruction **action_instructions;\n \tstruct rte_swx_table_state *table_state;\n+\tstruct instruction *instructions;\n \tstruct thread threads[RTE_SWX_PIPELINE_THREADS_MAX];\n \n \tuint32_t n_structs;\n@@ -310,6 +315,7 @@ struct rte_swx_pipeline {\n \tuint32_t n_actions;\n \tuint32_t n_tables;\n \tuint32_t n_headers;\n+\tuint32_t n_instructions;\n \tint build_done;\n \tint numa_node;\n };\n@@ -1424,6 +1430,12 @@ metadata_free(struct rte_swx_pipeline *p)\n /*\n * Instruction.\n */\n+static inline void\n+thread_ip_reset(struct rte_swx_pipeline *p, struct thread *t)\n+{\n+\tt->ip = p->instructions;\n+}\n+\n static int\n instruction_config(struct rte_swx_pipeline *p __rte_unused,\n \t\t struct action *a __rte_unused,\n@@ -2110,6 +2122,8 @@ rte_swx_pipeline_free(struct rte_swx_pipeline *p)\n \tif (!p)\n \t\treturn;\n \n+\tfree(p->instructions);\n+\n \ttable_state_free(p);\n \ttable_free(p);\n \taction_free(p);\n@@ -2124,6 +2138,28 @@ rte_swx_pipeline_free(struct rte_swx_pipeline *p)\n \tfree(p);\n }\n \n+int\n+rte_swx_pipeline_instructions_config(struct rte_swx_pipeline *p,\n+\t\t\t\t const char **instructions,\n+\t\t\t\t uint32_t n_instructions)\n+{\n+\tint err;\n+\tuint32_t i;\n+\n+\terr = instruction_config(p, NULL, instructions, n_instructions);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* Thread instruction pointer reset. */\n+\tfor (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {\n+\t\tstruct thread *t = &p->threads[i];\n+\n+\t\tthread_ip_reset(p, t);\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n rte_swx_pipeline_build(struct rte_swx_pipeline *p)\n {\ndiff --git a/lib/librte_pipeline/rte_swx_pipeline.h b/lib/librte_pipeline/rte_swx_pipeline.h\nindex d7e3ba1ec..47a0f8dcc 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.h\n+++ b/lib/librte_pipeline/rte_swx_pipeline.h\n@@ -495,6 +495,26 @@ rte_swx_pipeline_table_config(struct rte_swx_pipeline *p,\n \t\t\t const char *args,\n \t\t\t uint32_t size);\n \n+/**\n+ * Pipeline instructions configure\n+ *\n+ * @param[in] p\n+ * Pipeline handle.\n+ * @param[in] instructions\n+ * Pipeline instructions.\n+ * @param[in] n_instructions\n+ * Number of pipeline instructions.\n+ * @return\n+ * 0 on success or the following error codes otherwise:\n+ * -EINVAL: Invalid argument;\n+ * -ENOMEM: Not enough space/cannot allocate memory.\n+ */\n+__rte_experimental\n+int\n+rte_swx_pipeline_instructions_config(struct rte_swx_pipeline *p,\n+\t\t\t\t const char **instructions,\n+\t\t\t\t uint32_t n_instructions);\n+\n /**\n * Pipeline build\n *\n", "prefixes": [ "v2", "08/41" ] }{ "id": 76748, "url": "