get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/100924/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 100924,
    "url": "https://patches.dpdk.org/api/patches/100924/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211010000503.28712-2-ivan.malov@oktetlabs.ru/",
    "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": "<20211010000503.28712-2-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211010000503.28712-2-ivan.malov@oktetlabs.ru",
    "date": "2021-10-10T00:04:52",
    "name": "[v2,01/12] ethdev: add port representor item to flow API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5c3b2b81450be11988c94ebda8fa07f693b2111f",
    "submitter": {
        "id": 869,
        "url": "https://patches.dpdk.org/api/people/869/?format=api",
        "name": "Ivan Malov",
        "email": "Ivan.Malov@oktetlabs.ru"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211010000503.28712-2-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 19488,
            "url": "https://patches.dpdk.org/api/series/19488/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19488",
            "date": "2021-10-10T00:04:51",
            "name": "ethdev: rework transfer flow API",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/19488/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/100924/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/100924/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 B72F3A0C41;\n\tSun, 10 Oct 2021 02:05:26 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 72A5240E50;\n\tSun, 10 Oct 2021 02:05:20 +0200 (CEST)",
            "from shelob.oktetlabs.ru (unknown [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id E0B3340040\n for <dev@dpdk.org>; Sun, 10 Oct 2021 02:05:17 +0200 (CEST)",
            "from localhost.localdomain (unknown [5.144.122.166])\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 7C2077F5FD;\n Sun, 10 Oct 2021 03:05:11 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 7C2077F5FD",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1633824311;\n bh=qLeQ6F7lfw0LZovziZTa75b2NN+dyW11sL2D0vhYmrU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=RVQklVUWjLTrP3Y5GBvBC3OGr+UV/lQp7MeRiK4LZkH+zjhPcvW/IVKhnL265hFSQ\n GY9VhLUqRDXrl5FYyaIDjzhDKQng5fJmc5ENAm6xGgmyWjukrKNIkgireL4sKT4f9X\n bAwNzwBbJ7snkiw+WvdBeTx8jTrFVK2Kmoha+rQ4=",
        "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 03:04:52 +0300",
        "Message-Id": "<20211010000503.28712-2-ivan.malov@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20211010000503.28712-1-ivan.malov@oktetlabs.ru>",
        "References": "<20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru>\n <20211010000503.28712-1-ivan.malov@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 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..2e0f590777 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+    |  Embedded Switch Port  |  Logical Port\n+    '------------------------'\n+                ||\n+                ||\n+                ||\n+                \\/\n+    .------------------------.\n+    |  Embedded Flow Engine  |\n+    '------------------------'\n+                :\n+                 :\n+                :\n+                 :\n+    .------------------------.\n+    |  Embedded Switch Port  |  Logical Port\n+    '------------------------'\n+                :\n+                 :\n+    .------------------------.\n+    |    REPRESENTED_PORT    |  Net / Guest / Another Ethdev (Same Application)\n+    '------------------------'\n+\n+\n+- Incompatibe 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": [
        "v2",
        "01/12"
    ]
}