get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100947,
    "url": "https://patches.dpdk.org/api/patches/100947/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211010143930.4985-11-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": "<20211010143930.4985-11-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211010143930.4985-11-ivan.malov@oktetlabs.ru",
    "date": "2021-10-10T14:39:28",
    "name": "[v3,10/12] net/mlx5: support represented port flow action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0f420cca7899ace5444ecb206a245b142babf838",
    "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/20211010143930.4985-11-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 19490,
            "url": "https://patches.dpdk.org/api/series/19490/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19490",
            "date": "2021-10-10T14:39:18",
            "name": "ethdev: rework transfer flow API",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/19490/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/100947/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/100947/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 D033EA0C43;\n\tSun, 10 Oct 2021 16:41:03 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 64A9041147;\n\tSun, 10 Oct 2021 16:40:19 +0200 (CEST)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id BF9D6410E1\n for <dev@dpdk.org>; Sun, 10 Oct 2021 16:40:01 +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 709487F6DD;\n Sun, 10 Oct 2021 17:40:01 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 709487F6DD",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1633876801;\n bh=pwNPN6a/Vv4OwTKXX6MVzdlmL53XvNGEPl3v0vE+PNs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=LF4pBwzERr1RDkv8oLZjTuTF0qMTJl5RCs8ugO55RPtsldVOMWxRDhKn3T5gJUR/e\n odrBGjZs1190/QJNaMKJCK7aI5t1JHHugoCEJQHKJIZA5JH7hW/P7fkt8PtVM2Fz+P\n +kSa43h7qdaDiGjeJ6IYKX4PoQS7I2lTJzJgfXEg=",
        "From": "Ivan Malov <ivan.malov@oktetlabs.ru>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas@monjalon.net>, Ori Kam <orika@nvidia.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Date": "Sun, 10 Oct 2021 17:39:28 +0300",
        "Message-Id": "<20211010143930.4985-11-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 10/12] net/mlx5: support represented port flow\n action",
        "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": "From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n\nSemantics of the existing support for action PORT_ID suggests\nthat support for equal action REPRESENTED_PORT be implemented.\n\nHelper functions keep port_id suffix since action\nMLX5_FLOW_ACTION_PORT_ID is still used internally.\n\nSigned-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\n doc/guides/nics/mlx5.rst        |  4 +--\n drivers/net/mlx5/mlx5_flow_dv.c | 62 ++++++++++++++++++++++++++-------\n 2 files changed, 52 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex bae73f42d8..b76e979f47 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -431,8 +431,8 @@ Limitations\n      - yellow: NULL or END.\n      - RED: DROP / END.\n   - The only supported meter policy actions:\n-     - green: QUEUE, RSS, PORT_ID, JUMP, DROP, MARK and SET_TAG.\n-     - yellow: QUEUE, RSS, PORT_ID, JUMP, DROP, MARK and SET_TAG.\n+     - green: QUEUE, RSS, PORT_ID, REPRESENTED_PORT, JUMP, DROP, MARK and SET_TAG.\n+     - yellow: QUEUE, RSS, PORT_ID, REPRESENTED_PORT, JUMP, DROP, MARK and SET_TAG.\n      - RED: must be DROP.\n   - Policy actions of RSS for green and yellow should have the same configuration except queues.\n   - meter profile packet mode is supported.\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex c6370cd1d6..835cc5018c 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -5048,14 +5048,14 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,\n }\n \n /*\n- * Validate the port_id action.\n+ * Validate action PORT_ID / REPRESENTED_PORT.\n  *\n  * @param[in] dev\n  *   Pointer to rte_eth_dev structure.\n  * @param[in] action_flags\n  *   Bit-fields that holds the actions detected until now.\n  * @param[in] action\n- *   Port_id RTE action structure.\n+ *   PORT_ID / REPRESENTED_PORT action structure.\n  * @param[in] attr\n  *   Attributes of flow that includes this action.\n  * @param[out] error\n@@ -5072,6 +5072,7 @@ flow_dv_validate_action_port_id(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_flow_error *error)\n {\n \tconst struct rte_flow_action_port_id *port_id;\n+\tconst struct rte_flow_action_ethdev *ethdev;\n \tstruct mlx5_priv *act_priv;\n \tstruct mlx5_priv *dev_priv;\n \tuint16_t port;\n@@ -5080,13 +5081,13 @@ flow_dv_validate_action_port_id(struct rte_eth_dev *dev,\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t  NULL,\n-\t\t\t\t\t  \"port id action is valid in transfer\"\n+\t\t\t\t\t  \"port action is valid in transfer\"\n \t\t\t\t\t  \" mode only\");\n \tif (!action || !action->conf)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION_CONF,\n \t\t\t\t\t  NULL,\n-\t\t\t\t\t  \"port id action parameters must be\"\n+\t\t\t\t\t  \"port action parameters must be\"\n \t\t\t\t\t  \" specified\");\n \tif (action_flags & (MLX5_FLOW_FATE_ACTIONS |\n \t\t\t    MLX5_FLOW_FATE_ESWITCH_ACTIONS))\n@@ -5100,13 +5101,26 @@ flow_dv_validate_action_port_id(struct rte_eth_dev *dev,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t  NULL,\n \t\t\t\t\t  \"failed to obtain E-Switch info\");\n-\tport_id = action->conf;\n-\tport = port_id->original ? dev->data->port_id : port_id->id;\n+\tswitch (action->type) {\n+\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\tport_id = action->conf;\n+\t\tport = port_id->original ? dev->data->port_id : port_id->id;\n+\t\tbreak;\n+\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n+\t\tethdev = action->conf;\n+\t\tport = ethdev->port_id;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn rte_flow_error_set\n+\t\t\t\t(error, EINVAL,\n+\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t \"unknown E-Switch action\");\n+\t}\n \tact_priv = mlx5_port_to_eswitch_info(port, false);\n \tif (!act_priv)\n \t\treturn rte_flow_error_set\n \t\t\t\t(error, rte_errno,\n-\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION_CONF, port_id,\n+\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION_CONF, action->conf,\n \t\t\t\t \"failed to obtain E-Switch port id for port\");\n \tif (act_priv->domain_id != dev_priv->domain_id)\n \t\treturn rte_flow_error_set\n@@ -5669,6 +5683,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags,\n \t\t\t++actions_n;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\tret = flow_dv_validate_action_port_id(dev,\n \t\t\t\t\t\t\t      sub_action_flags,\n \t\t\t\t\t\t\t      act,\n@@ -7296,6 +7311,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\tret = flow_dv_validate_action_port_id(dev,\n \t\t\t\t\t\t\t      action_flags,\n \t\t\t\t\t\t\t      actions,\n@@ -10770,12 +10786,12 @@ flow_dv_tag_release(struct rte_eth_dev *dev,\n }\n \n /**\n- * Translate port ID action to vport.\n+ * Translate action PORT_ID / REPRESENTED_PORT to vport.\n  *\n  * @param[in] dev\n  *   Pointer to rte_eth_dev structure.\n  * @param[in] action\n- *   Pointer to the port ID action.\n+ *   Pointer to action PORT_ID / REPRESENTED_PORT.\n  * @param[out] dst_port_id\n  *   The target port ID.\n  * @param[out] error\n@@ -10792,10 +10808,28 @@ flow_dv_translate_action_port_id(struct rte_eth_dev *dev,\n {\n \tuint32_t port;\n \tstruct mlx5_priv *priv;\n-\tconst struct rte_flow_action_port_id *conf =\n-\t\t\t(const struct rte_flow_action_port_id *)action->conf;\n \n-\tport = conf->original ? dev->data->port_id : conf->id;\n+\tswitch (action->type) {\n+\tcase RTE_FLOW_ACTION_TYPE_PORT_ID: {\n+\t\tconst struct rte_flow_action_port_id *conf;\n+\n+\t\tconf = (const struct rte_flow_action_port_id *)action->conf;\n+\t\tport = conf->original ? dev->data->port_id : conf->id;\n+\t\tbreak;\n+\t}\n+\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: {\n+\t\tconst struct rte_flow_action_ethdev *ethdev;\n+\n+\t\tethdev = (const struct rte_flow_action_ethdev *)action->conf;\n+\t\tport = ethdev->port_id;\n+\t\tbreak;\n+\t}\n+\tdefault:\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, action,\n+\t\t\t\t\t  \"unknown E-Switch action\");\n+\t}\n+\n \tpriv = mlx5_port_to_eswitch_info(port, false);\n \tif (!priv)\n \t\treturn rte_flow_error_set(error, -rte_errno,\n@@ -11634,6 +11668,7 @@ flow_dv_translate_action_sample(struct rte_eth_dev *dev,\n \t\t\tbreak;\n \t\t}\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t{\n \t\t\tstruct mlx5_flow_dv_port_id_action_resource\n \t\t\t\t\tport_id_resource;\n@@ -12714,6 +12749,7 @@ flow_dv_translate(struct rte_eth_dev *dev,\n \t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\tif (flow_dv_translate_action_port_id(dev, action,\n \t\t\t\t\t\t\t     &port_id, error))\n \t\t\t\treturn -rte_errno;\n@@ -15475,6 +15511,7 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\t{\n \t\t\t\tstruct mlx5_flow_dv_port_id_action_resource\n \t\t\t\t\tport_id_resource;\n@@ -17683,6 +17720,7 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,\n \t\t\t\t\t  NULL, \"too many actions\");\n \t\t\tswitch (act->type) {\n \t\t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n+\t\t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\t\tif (!priv->config.dv_esw_en)\n \t\t\t\t\treturn -rte_mtr_error_set(error,\n \t\t\t\t\tENOTSUP,\n",
    "prefixes": [
        "v3",
        "10/12"
    ]
}