get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87671,
    "url": "https://patches.dpdk.org/api/patches/87671/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1612340957-128181-1-git-send-email-jiaweiw@nvidia.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": "<1612340957-128181-1-git-send-email-jiaweiw@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612340957-128181-1-git-send-email-jiaweiw@nvidia.com",
    "date": "2021-02-03T08:29:17",
    "name": "net/mlx5: fix E-Switch egress mirror flow validation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9cf0a9c08feddb53ca7d00ebba492de42df7b443",
    "submitter": {
        "id": 1939,
        "url": "https://patches.dpdk.org/api/people/1939/?format=api",
        "name": "Jiawei Wang",
        "email": "jiaweiw@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1612340957-128181-1-git-send-email-jiaweiw@nvidia.com/mbox/",
    "series": [
        {
            "id": 15117,
            "url": "https://patches.dpdk.org/api/series/15117/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15117",
            "date": "2021-02-03T08:29:17",
            "name": "net/mlx5: fix E-Switch egress mirror flow validation",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15117/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87671/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/87671/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 5BFFBA0A0E;\n\tWed,  3 Feb 2021 09:29:22 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D911C240461;\n\tWed,  3 Feb 2021 09:29:21 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 3781C240447\n for <dev@dpdk.org>; Wed,  3 Feb 2021 09:29:21 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n jiaweiw@nvidia.com) with SMTP; 3 Feb 2021 10:29:17 +0200",
            "from nvidia.com (gen-l-vrt-280.mtl.labs.mlnx [10.237.45.1])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 1138THq9023813;\n Wed, 3 Feb 2021 10:29:17 +0200"
        ],
        "From": "Jiawei Wang <jiaweiw@nvidia.com>",
        "To": "viacheslavo@nvidia.com, matan@nvidia.com, orika@nvidia.com,\n thomas@monjalon.net",
        "Cc": "dev@dpdk.org, rasland@nvidia.com, stable@dpdk.org",
        "Date": "Wed,  3 Feb 2021 10:29:17 +0200",
        "Message-Id": "<1612340957-128181-1-git-send-email-jiaweiw@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix E-Switch egress mirror flow\n validation",
        "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": "The stored metadata in all registers C were lost in E-Switch egress\nmirroring flows due to HW limitation. The register C0 keeps the\nsource vport index that also was used as one of the flow matcher.\n\nWhile sample action and jump action (jump to table X) was in the\nE-Switch egress flow, the flow in the next table X wasn't hit since\nsource vport value lost.\n\nThe modify actions after sample action should be applied to the packet\non normal path, not to the sampled packet. In order to support this\nmlx5 PMD splits the flow into sub flows and jump action is engaged\nimplicitly, causing malfunction due to registers corruption.\n\nThis patch adds the validation the for E-Switch mirroring jump egress\nflow, and checks for this hidden jump as well and reject the flows with\nmodify actions after sampling.\n\nFixes: 6a951567c159 (\"net/mlx5: support E-Switch mirroring and jump in one flow\")\nCc: stable@dpdk.org\n\nSigned-off-by: Jiawei Wang <jiaweiw@nvidia.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 47 +++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 8c11ac3..ee1c4f4 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -5081,6 +5081,8 @@ struct mlx5_hlist_entry *\n  *   Pointer to the RSS action.\n  * @param[out] sample_rss\n  *   Pointer to the RSS action in sample action list.\n+ * @param[out] fdb_mirror_limit\n+ *   Pointer to the FDB mirror limitation flag.\n  * @param[out] error\n  *   Pointer to error structure.\n  *\n@@ -5095,6 +5097,7 @@ struct mlx5_hlist_entry *\n \t\t\t       uint64_t item_flags,\n \t\t\t       const struct rte_flow_action_rss *rss,\n \t\t\t       const struct rte_flow_action_rss **sample_rss,\n+\t\t\t       int *fdb_mirror_limit,\n \t\t\t       struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -5269,6 +5272,9 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t\t  NULL,\n \t\t\t\t\t\t  \"E-Switch must has a dest \"\n \t\t\t\t\t\t  \"port for mirroring\");\n+\t\tif (!priv->config.hca_attr.reg_c_preserve &&\n+\t\t     priv->representor_id != -1)\n+\t\t\t*fdb_mirror_limit = 1;\n \t}\n \t/* Continue validation for Xcap actions.*/\n \tif ((sub_action_flags & MLX5_FLOW_XCAP_ACTIONS) &&\n@@ -6010,6 +6016,8 @@ struct mlx5_hlist_entry *\n \tuint16_t ether_type = 0;\n \tint actions_n = 0;\n \tuint8_t item_ipv6_proto = 0;\n+\tint fdb_mirror_limit = 0;\n+\tint modify_after_mirror = 0;\n \tconst struct rte_flow_item *geneve_item = NULL;\n \tconst struct rte_flow_item *gre_item = NULL;\n \tconst struct rte_flow_item *gtp_item = NULL;\n@@ -6429,6 +6437,9 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t++actions_n;\n \t\t\t\taction_flags |= MLX5_FLOW_ACTION_FLAG |\n \t\t\t\t\t\tMLX5_FLOW_ACTION_MARK_EXT;\n+\t\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\t\tmodify_after_mirror = 1;\n+\n \t\t\t} else {\n \t\t\t\taction_flags |= MLX5_FLOW_ACTION_FLAG;\n \t\t\t\t++actions_n;\n@@ -6448,6 +6459,8 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t++actions_n;\n \t\t\t\taction_flags |= MLX5_FLOW_ACTION_MARK |\n \t\t\t\t\t\tMLX5_FLOW_ACTION_MARK_EXT;\n+\t\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\t\tmodify_after_mirror = 1;\n \t\t\t} else {\n \t\t\t\taction_flags |= MLX5_FLOW_ACTION_MARK;\n \t\t\t\t++actions_n;\n@@ -6463,6 +6476,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_SET_META;\n \t\t\trw_act_num += MLX5_ACT_NUM_SET_META;\n \t\t\tbreak;\n@@ -6475,6 +6490,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_SET_TAG;\n \t\t\trw_act_num += MLX5_ACT_NUM_SET_TAG;\n \t\t\tbreak;\n@@ -6635,6 +6652,8 @@ struct mlx5_hlist_entry *\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_SET_MAC_SRC ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_MAC_SRC :\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_MAC_DST;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\t/*\n \t\t\t * Even if the source and destination MAC addresses have\n \t\t\t * overlap in the header with 4B alignment, the convert\n@@ -6655,6 +6674,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_SET_IPV4_SRC ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_IPV4_SRC :\n@@ -6678,6 +6699,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_SET_IPV6_SRC ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_IPV6_SRC :\n@@ -6695,6 +6718,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_SET_TP_SRC ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_TP_SRC :\n@@ -6712,6 +6737,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_SET_TTL ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_SET_TTL :\n@@ -6725,6 +6752,12 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t\t\t   error);\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n+\t\t\tif ((action_flags & MLX5_FLOW_ACTION_SAMPLE) &&\n+\t\t\t    fdb_mirror_limit)\n+\t\t\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\t  NULL,\n+\t\t\t\t\t\t  \"sample and jump action combination is not supported\");\n \t\t\t++actions_n;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_JUMP;\n \t\t\tbreak;\n@@ -6740,6 +6773,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_INC_TCP_SEQ ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_INC_TCP_SEQ :\n@@ -6758,6 +6793,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= actions->type ==\n \t\t\t\t\tRTE_FLOW_ACTION_TYPE_INC_TCP_ACK ?\n \t\t\t\t\t\tMLX5_FLOW_ACTION_INC_TCP_ACK :\n@@ -6811,6 +6848,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_SET_IPV4_DSCP;\n \t\t\trw_act_num += MLX5_ACT_NUM_SET_DSCP;\n \t\t\tbreak;\n@@ -6825,6 +6864,8 @@ struct mlx5_hlist_entry *\n \t\t\t/* Count all modify-header actions as one action. */\n \t\t\tif (!(action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS))\n \t\t\t\t++actions_n;\n+\t\t\tif (action_flags & MLX5_FLOW_ACTION_SAMPLE)\n+\t\t\t\tmodify_after_mirror = 1;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_SET_IPV6_DSCP;\n \t\t\trw_act_num += MLX5_ACT_NUM_SET_DSCP;\n \t\t\tbreak;\n@@ -6833,6 +6874,7 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t\t\t     actions, dev,\n \t\t\t\t\t\t\t     attr, item_flags,\n \t\t\t\t\t\t\t     rss, &sample_rss,\n+\t\t\t\t\t\t\t     &fdb_mirror_limit,\n \t\t\t\t\t\t\t     error);\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n@@ -7031,6 +7073,11 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t  NULL, \"too many header modify\"\n \t\t\t\t\t  \" actions to support\");\n \t}\n+\t/* Eswitch egress mirror and modify flow has limitation on CX5 */\n+\tif (fdb_mirror_limit && modify_after_mirror)\n+\t\treturn rte_flow_error_set(error, EINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, NULL,\n+\t\t\t\t\"sample before modify action is not supported\");\n \treturn 0;\n }\n \n",
    "prefixes": []
}