Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/46607/?format=api
http://patches.dpdk.org/api/patches/46607/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1539258078-85906-1-git-send-email-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": "<1539258078-85906-1-git-send-email-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1539258078-85906-1-git-send-email-cristian.dumitrescu@intel.com", "date": "2018-10-11T11:41:11", "name": "[v4,1/8] pipeline: add table action for packet tag", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "295ac52590b45e2aae965eb1c37ab86ae045614d", "submitter": { "id": 19, "url": "http://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@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/1539258078-85906-1-git-send-email-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 1834, "url": "http://patches.dpdk.org/api/series/1834/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1834", "date": "2018-10-11T11:41:12", "name": "[v4,1/8] pipeline: add table action for packet tag", "version": 4, "mbox": "http://patches.dpdk.org/series/1834/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/46607/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/46607/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 96E661B568;\n\tThu, 11 Oct 2018 13:41:54 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id 530D71B53E\n\tfor <dev@dpdk.org>; Thu, 11 Oct 2018 13:41:47 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Oct 2018 04:41:44 -0700", "from silpixa00382658.ir.intel.com ([10.237.223.29])\n\tby fmsmga002.fm.intel.com with ESMTP; 11 Oct 2018 04:41:35 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,368,1534834800\"; d=\"scan'208\";a=\"94289030\"", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 11 Oct 2018 12:41:11 +0100", "Message-Id": "<1539258078-85906-1-git-send-email-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.7.4", "Subject": "[dpdk-dev] [PATCH v4 1/8] pipeline: add table action for packet tag", "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": "This patch introduces the packet tag table action which attaches\na 32-bit value (the tag) to the current input packet. The tag is\nread from the current table entry. The tag is written into the\nmbuf->hash.fdir.hi and the flags PKT_RX_FDIR and PKT_RX_FDIR_ID\nare set into mbuf->ol_flags.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_pipeline/rte_table_action.c | 78 ++++++++++++++++++++++++++++++++++\n lib/librte_pipeline/rte_table_action.h | 12 ++++++\n 2 files changed, 90 insertions(+)", "diff": "diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c\nindex edb3340..fb7eaf9 100644\n--- a/lib/librte_pipeline/rte_table_action.c\n+++ b/lib/librte_pipeline/rte_table_action.c\n@@ -2012,6 +2012,50 @@ pkt_work_sym_crypto(struct rte_mbuf *mbuf, struct sym_crypto_data *data,\n }\n \n /**\n+ * RTE_TABLE_ACTION_TAG\n+ */\n+struct tag_data {\n+\tuint32_t tag;\n+} __attribute__((__packed__));\n+\n+static int\n+tag_apply(struct tag_data *data,\n+\tstruct rte_table_action_tag_params *p)\n+{\n+\tdata->tag = p->tag;\n+\treturn 0;\n+}\n+\n+static __rte_always_inline void\n+pkt_work_tag(struct rte_mbuf *mbuf,\n+\tstruct tag_data *data)\n+{\n+\tmbuf->hash.fdir.hi = data->tag;\n+\tmbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n+}\n+\n+static __rte_always_inline void\n+pkt4_work_tag(struct rte_mbuf *mbuf0,\n+\tstruct rte_mbuf *mbuf1,\n+\tstruct rte_mbuf *mbuf2,\n+\tstruct rte_mbuf *mbuf3,\n+\tstruct tag_data *data0,\n+\tstruct tag_data *data1,\n+\tstruct tag_data *data2,\n+\tstruct tag_data *data3)\n+{\n+\tmbuf0->hash.fdir.hi = data0->tag;\n+\tmbuf1->hash.fdir.hi = data1->tag;\n+\tmbuf2->hash.fdir.hi = data2->tag;\n+\tmbuf3->hash.fdir.hi = data3->tag;\n+\n+\tmbuf0->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n+\tmbuf1->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n+\tmbuf2->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n+\tmbuf3->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n+}\n+\n+/**\n * Action profile\n */\n static int\n@@ -2028,6 +2072,7 @@ action_valid(enum rte_table_action_type action)\n \tcase RTE_TABLE_ACTION_STATS:\n \tcase RTE_TABLE_ACTION_TIME:\n \tcase RTE_TABLE_ACTION_SYM_CRYPTO:\n+\tcase RTE_TABLE_ACTION_TAG:\n \t\treturn 1;\n \tdefault:\n \t\treturn 0;\n@@ -2162,6 +2207,9 @@ action_data_size(enum rte_table_action_type action,\n \tcase RTE_TABLE_ACTION_SYM_CRYPTO:\n \t\treturn (sizeof(struct sym_crypto_data));\n \n+\tcase RTE_TABLE_ACTION_TAG:\n+\t\treturn sizeof(struct tag_data);\n+\n \tdefault:\n \t\treturn 0;\n \t}\n@@ -2419,6 +2467,10 @@ rte_table_action_apply(struct rte_table_action *action,\n \t\t\t\t&action->cfg.sym_crypto,\n \t\t\t\taction_params);\n \n+\tcase RTE_TABLE_ACTION_TAG:\n+\t\treturn tag_apply(action_data,\n+\t\t\taction_params);\n+\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n@@ -2803,6 +2855,14 @@ pkt_work(struct rte_mbuf *mbuf,\n \t\t\t\tip_offset);\n \t}\n \n+\tif (cfg->action_mask & (1LLU << RTE_TABLE_ACTION_TAG)) {\n+\t\tvoid *data = action_data_get(table_entry,\n+\t\t\taction,\n+\t\t\tRTE_TABLE_ACTION_TAG);\n+\n+\t\tpkt_work_tag(mbuf, data);\n+\t}\n+\n \treturn drop_mask;\n }\n \n@@ -3111,6 +3171,24 @@ pkt4_work(struct rte_mbuf **mbufs,\n \t\t\t\tip_offset);\n \t}\n \n+\tif (cfg->action_mask & (1LLU << RTE_TABLE_ACTION_TAG)) {\n+\t\tvoid *data0 = action_data_get(table_entry0,\n+\t\t\taction,\n+\t\t\tRTE_TABLE_ACTION_TAG);\n+\t\tvoid *data1 = action_data_get(table_entry1,\n+\t\t\taction,\n+\t\t\tRTE_TABLE_ACTION_TAG);\n+\t\tvoid *data2 = action_data_get(table_entry2,\n+\t\t\taction,\n+\t\t\tRTE_TABLE_ACTION_TAG);\n+\t\tvoid *data3 = action_data_get(table_entry3,\n+\t\t\taction,\n+\t\t\tRTE_TABLE_ACTION_TAG);\n+\n+\t\tpkt4_work_tag(mbuf0, mbuf1, mbuf2, mbuf3,\n+\t\t\tdata0, data1, data2, data3);\n+\t}\n+\n \treturn drop_mask0 |\n \t\t(drop_mask1 << 1) |\n \t\t(drop_mask2 << 2) |\ndiff --git a/lib/librte_pipeline/rte_table_action.h b/lib/librte_pipeline/rte_table_action.h\nindex e8a7b66..5dbb147 100644\n--- a/lib/librte_pipeline/rte_table_action.h\n+++ b/lib/librte_pipeline/rte_table_action.h\n@@ -96,6 +96,9 @@ enum rte_table_action_type {\n \n \t/** Crypto. */\n \tRTE_TABLE_ACTION_SYM_CRYPTO,\n+\n+\t/** Tag. */\n+\tRTE_TABLE_ACTION_TAG,\n };\n \n /** Common action configuration (per table action profile). */\n@@ -771,6 +774,15 @@ struct rte_table_action_sym_crypto_params {\n };\n \n /**\n+ * RTE_TABLE_ACTION_TAG\n+ */\n+/** Tag action parameters (per table rule). */\n+struct rte_table_action_tag_params {\n+\t/** Tag to be attached to the input packet. */\n+\tuint32_t tag;\n+};\n+\n+/**\n * Table action profile.\n */\n struct rte_table_action_profile;\n", "prefixes": [ "v4", "1/8" ] }{ "id": 46607, "url": "