Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/100938/?format=api
http://patches.dpdk.org/api/patches/100938/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211010143930.4985-2-ivan.malov@oktetlabs.ru/", "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": "<20211010143930.4985-2-ivan.malov@oktetlabs.ru>", "list_archive_url": "https://inbox.dpdk.org/dev/20211010143930.4985-2-ivan.malov@oktetlabs.ru", "date": "2021-10-10T14:39:19", "name": "[v3,01/12] ethdev: add port representor item to flow API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c55339038b89b0ab61834b9c562d6a16fda612a2", "submitter": { "id": 869, "url": "http://patches.dpdk.org/api/people/869/?format=api", "name": "Ivan Malov", "email": "Ivan.Malov@oktetlabs.ru" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211010143930.4985-2-ivan.malov@oktetlabs.ru/mbox/", "series": [ { "id": 19490, "url": "http://patches.dpdk.org/api/series/19490/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19490", "date": "2021-10-10T14:39:18", "name": "ethdev: rework transfer flow API", "version": 3, "mbox": "http://patches.dpdk.org/series/19490/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/100938/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/100938/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 DF430A0C43;\n\tSun, 10 Oct 2021 16:40:07 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A6C2E40F35;\n\tSun, 10 Oct 2021 16:40:01 +0200 (CEST)", "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 74C2240042\n for <dev@dpdk.org>; Sun, 10 Oct 2021 16:39:59 +0200 (CEST)", "from localhost.localdomain (unknown [5.144.123.197])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 13A837F6BF;\n Sun, 10 Oct 2021 17:39:59 +0300 (MSK)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 13A837F6BF", "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1633876799;\n bh=ysdVuRovoqd0Vztk/w/MtKBkiFOJeoONhVGpme5E/eE=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=lGjnANxfhSyHe6wPRgGlNcowcyQGbCREMjSwe7OOaW8N+UihpfyUzH7m9y0Fj/sLh\n ulk+APWbgU4G2jzUmjoSRW1+tv0H3nXLG+gVO60YGqhiGJyqfxOf7QXkrzqE0vT0fh\n 6gBqWCMO34KTWZxda2YxaYIoQeN40OYKxjS3LVMM=", "From": "Ivan Malov <ivan.malov@oktetlabs.ru>", "To": "dev@dpdk.org", "Cc": "Thomas Monjalon <thomas@monjalon.net>, Ori Kam <orika@nvidia.com>,\n Xiaoyun Li <xiaoyun.li@intel.com>, Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>", "Date": "Sun, 10 Oct 2021 17:39:19 +0300", "Message-Id": "<20211010143930.4985-2-ivan.malov@oktetlabs.ru>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20211010143930.4985-1-ivan.malov@oktetlabs.ru>", "References": "<20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru>\n <20211010143930.4985-1-ivan.malov@oktetlabs.ru>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 01/12] ethdev: add port representor item to\n flow API", "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": "For use in \"transfer\" flows. Supposed to match traffic\nentering the embedded switch from the given ethdev.\n\nMust not be combined with direction attributes.\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\n---\n app/test-pmd/cmdline_flow.c | 27 ++++++++++\n doc/guides/prog_guide/rte_flow.rst | 59 +++++++++++++++++++++\n doc/guides/rel_notes/release_21_11.rst | 2 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++\n lib/ethdev/rte_flow.c | 1 +\n lib/ethdev/rte_flow.h | 27 ++++++++++\n 6 files changed, 120 insertions(+)", "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex bb22294dd3..a912a8d815 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -306,6 +306,8 @@ enum index {\n \tITEM_POL_PORT,\n \tITEM_POL_METER,\n \tITEM_POL_POLICY,\n+\tITEM_PORT_REPRESENTOR,\n+\tITEM_PORT_REPRESENTOR_PORT_ID,\n \n \t/* Validate/create actions. */\n \tACTIONS,\n@@ -1000,6 +1002,7 @@ static const enum index next_item[] = {\n \tITEM_GENEVE_OPT,\n \tITEM_INTEGRITY,\n \tITEM_CONNTRACK,\n+\tITEM_PORT_REPRESENTOR,\n \tEND_SET,\n \tZERO,\n };\n@@ -1368,6 +1371,12 @@ static const enum index item_integrity_lv[] = {\n \tZERO,\n };\n \n+static const enum index item_port_representor[] = {\n+\tITEM_PORT_REPRESENTOR_PORT_ID,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n static const enum index next_action[] = {\n \tACTION_END,\n \tACTION_VOID,\n@@ -3608,6 +3617,21 @@ static const struct token token_list[] = {\n \t\t\t item_param),\n \t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_conntrack, flags)),\n \t},\n+\t[ITEM_PORT_REPRESENTOR] = {\n+\t\t.name = \"port_representor\",\n+\t\t.help = \"match traffic entering the embedded switch from the given ethdev\",\n+\t\t.priv = PRIV_ITEM(PORT_REPRESENTOR,\n+\t\t\t\t sizeof(struct rte_flow_item_ethdev)),\n+\t\t.next = NEXT(item_port_representor),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_PORT_REPRESENTOR_PORT_ID] = {\n+\t\t.name = \"port_id\",\n+\t\t.help = \"ethdev port ID\",\n+\t\t.next = NEXT(item_port_representor, NEXT_ENTRY(COMMON_UNSIGNED),\n+\t\t\t item_param),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, port_id)),\n+\t},\n \t/* Validate/create actions. */\n \t[ACTIONS] = {\n \t\t.name = \"actions\",\n@@ -8343,6 +8367,9 @@ flow_item_default_mask(const struct rte_flow_item *item)\n \tcase RTE_FLOW_ITEM_TYPE_PFCP:\n \t\tmask = &rte_flow_item_pfcp_mask;\n \t\tbreak;\n+\tcase RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR:\n+\t\tmask = &rte_flow_item_ethdev_mask;\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\ndiff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst\nindex 2b42d5ec8c..91d5bdd712 100644\n--- a/doc/guides/prog_guide/rte_flow.rst\n+++ b/doc/guides/prog_guide/rte_flow.rst\n@@ -1425,6 +1425,65 @@ Matches a conntrack state after conntrack action.\n - ``flags``: conntrack packet state flags.\n - Default ``mask`` matches all state bits.\n \n+Item: ``PORT_REPRESENTOR``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Matches traffic entering the embedded switch from the given ethdev.\n+\n+Term **ethdev** and the concept of **port representor** are synonymous.\n+The **represented port** is an *entity* plugged to the embedded switch\n+at the opposite end of the \"wire\" leading to the ethdev.\n+\n+::\n+\n+ .--------------------.\n+ | PORT_REPRESENTOR | Ethdev (Application Port Referred to by its ID)\n+ '--------------------'\n+ ||\n+ \\/\n+ .----------------.\n+ | Logical Port |\n+ '----------------'\n+ ||\n+ ||\n+ ||\n+ \\/\n+ .----------.\n+ | Switch |\n+ '----------'\n+ :\n+ :\n+ :\n+ :\n+ .----------------.\n+ | Logical Port |\n+ '----------------'\n+ :\n+ :\n+ .--------------------.\n+ | REPRESENTED_PORT | Net / Guest / Another Ethdev (Same Application)\n+ '--------------------'\n+\n+\n+- Incompatible with `Attribute: Traffic direction`_.\n+- Requires `Attribute: Transfer`_.\n+\n+.. _table_rte_flow_item_ethdev:\n+\n+.. table:: ``struct rte_flow_item_ethdev``\n+\n+ +----------+-------------+---------------------------+\n+ | Field | Subfield | Value |\n+ +==========+=============+===========================+\n+ | ``spec`` | ``port_id`` | ethdev port ID |\n+ +----------+-------------+---------------------------+\n+ | ``last`` | ``port_id`` | upper range value |\n+ +----------+-------------+---------------------------+\n+ | ``mask`` | ``port_id`` | zeroed for wildcard match |\n+ +----------+-------------+---------------------------+\n+\n+- Default ``mask`` provides exact match behaviour.\n+\n Actions\n ~~~~~~~\n \ndiff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst\nindex 89d4b33ef1..1261cb2bf3 100644\n--- a/doc/guides/rel_notes/release_21_11.rst\n+++ b/doc/guides/rel_notes/release_21_11.rst\n@@ -188,6 +188,8 @@ API Changes\n Also, make sure to start the actual text at the margin.\n =======================================================\n \n+* ethdev: Added item ``PORT_REPRESENTOR`` to flow API.\n+\n * kvargs: The experimental function ``rte_kvargs_strcmp()`` has been\n removed. Its usages have been replaced by a new function\n ``rte_kvargs_get_with_value()``.\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 8ead7a4a71..dcb9f47d98 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3795,6 +3795,10 @@ This section lists supported pattern items and their attributes, if any.\n \n - ``conntrack``: match conntrack state.\n \n+- ``port_representor``: match traffic entering the embedded switch from the given ethdev\n+\n+ - ``port_id {unsigned}``: ethdev port ID\n+\n Actions list\n ^^^^^^^^^^^^\n \ndiff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c\nindex 8cb7a069c8..5e9317c6d1 100644\n--- a/lib/ethdev/rte_flow.c\n+++ b/lib/ethdev/rte_flow.c\n@@ -100,6 +100,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {\n \tMK_FLOW_ITEM(GENEVE_OPT, sizeof(struct rte_flow_item_geneve_opt)),\n \tMK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)),\n \tMK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)),\n+\tMK_FLOW_ITEM(PORT_REPRESENTOR, sizeof(struct rte_flow_item_ethdev)),\n };\n \n /** Generate flow_action[] entry. */\ndiff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h\nindex 7b1ed7f110..3625fd2c12 100644\n--- a/lib/ethdev/rte_flow.h\n+++ b/lib/ethdev/rte_flow.h\n@@ -574,6 +574,15 @@ enum rte_flow_item_type {\n \t * @see struct rte_flow_item_conntrack.\n \t */\n \tRTE_FLOW_ITEM_TYPE_CONNTRACK,\n+\n+\t/**\n+\t * [META]\n+\t *\n+\t * Matches traffic entering the embedded switch from the given ethdev.\n+\t *\n+\t * @see struct rte_flow_item_ethdev\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR,\n };\n \n /**\n@@ -1799,6 +1808,24 @@ static const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask = {\n };\n #endif\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice\n+ *\n+ * Provides an ethdev port ID for use with the following items:\n+ * RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR.\n+ */\n+struct rte_flow_item_ethdev {\n+\tuint16_t port_id; /**< ethdev port ID */\n+};\n+\n+/** Default mask for items based on struct rte_flow_item_ethdev */\n+#ifndef __cplusplus\n+static const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask = {\n+\t.port_id = 0xffff,\n+};\n+#endif\n+\n /**\n * Matching pattern item definition.\n *\n", "prefixes": [ "v3", "01/12" ] }{ "id": 100938, "url": "