get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96141,
    "url": "http://patchwork.dpdk.org/api/patches/96141/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210721085421.13111-4-bingz@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20210721085421.13111-4-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210721085421.13111-4-bingz@nvidia.com",
    "date": "2021-07-21T08:54:17",
    "name": "[v3,3/7] net/mlx5: added support for yellow policy rules",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0a62af313325f4b18ec3d028c0ada32bec619876",
    "submitter": {
        "id": 1976,
        "url": "http://patchwork.dpdk.org/api/people/1976/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@nvidia.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210721085421.13111-4-bingz@nvidia.com/mbox/",
    "series": [
        {
            "id": 17928,
            "url": "http://patchwork.dpdk.org/api/series/17928/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17928",
            "date": "2021-07-21T08:54:14",
            "name": "support yellow color policy in mlx5",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/17928/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96141/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96141/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 2288FA0C50;\n\tWed, 21 Jul 2021 10:55:05 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5424041101;\n\tWed, 21 Jul 2021 10:54:50 +0200 (CEST)",
            "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46])\n by mails.dpdk.org (Postfix) with ESMTP id 0E37A410DA\n for <dev@dpdk.org>; Wed, 21 Jul 2021 10:54:48 +0200 (CEST)",
            "from MW4PR04CA0072.namprd04.prod.outlook.com (2603:10b6:303:6b::17)\n by BY5PR12MB3825.namprd12.prod.outlook.com (2603:10b6:a03:1a2::15)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.29; Wed, 21 Jul\n 2021 08:54:46 +0000",
            "from CO1NAM11FT038.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:6b:cafe::e0) by MW4PR04CA0072.outlook.office365.com\n (2603:10b6:303:6b::17) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23 via Frontend\n Transport; Wed, 21 Jul 2021 08:54:46 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n CO1NAM11FT038.mail.protection.outlook.com (10.13.174.231) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 08:54:45 +0000",
            "from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 21 Jul\n 2021 08:54:43 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=I/VI6PsG+XLbk4qUeX+/mYOGZ7AeJZqfcNZl34+QZNabphzLLxrIuGvXUwIM6AnBPnQgDnIpdEtrwDDXNZ20vQ37150vUdteWztPgrQCD1FypgTfbV17bjwmfIy5VqOuHo/r+vlNTDpsj2pcA8719SLOrn+6wL+6b0nk/YerRn3s9+f41am2qXaEoDfc/aRBU/6uKvpGhc2DKrHQ7tM81g3nJYQ4UxFdQJwUr1yzZ1LyFU08UVKRGWdquXND2Otgurm1N0s/uugSZIyLqDLfkmHm5L51ec+pXw5hD+ccAkGKHKrZKlPQS2mjxbKPJ6ECR3+Ma5mthDDiKmuef0mGQw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=S9+TxTxAHV9uSEq89RGd0TFzNErQHU9g7PfuUSoX2GQ=;\n b=d3n0fbNsydmIfaEGL+B6ulE1Lg3/5133sZzdg6ijDK2W24Xmp6cs2egkzOUilfIlhIfLHJanf5zOD7WH45eknJW9fyDi8ssoNgJIOBMdlyCJ/OTRfz7ccthnY8KzNgtCjqjXyagRnHPvsyKF+LLOy/WxpYAs7qxNB+mxTI7Ud9+r5khVscaMMHafV4eiiyP7B5k2i8uzhD866MD3VlaGGTVsOBXqupGdfcqkxAw/bOqyP+5twih0VJ77BeYjxmQkMtRuPR026IFDQwlM6UNT0cCSjM/oucsbeIDb6xw+zuTG7yazCpUTf/riGDxAVqzOM9Jfx+DsXVLfMlZ5NU+EVA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=S9+TxTxAHV9uSEq89RGd0TFzNErQHU9g7PfuUSoX2GQ=;\n b=ruwl/WO9rIdYV9tZ+DYBkCq5hv7fP/JZn75LFczkZmoLSa5uVluhnnSwbo/yE9WGzUb0UgUuB2nWwdaA656Jw8yNlesoJEXpV9GmR9EZyXqiTBqBczri7ugEekPGZEnIzjVobE7Y4dwFas7UWZGfX3sszWqXvBP6Z/51UEIEzaIUHbUPqu8baIqJlomaTjE3uyxSnHLR6PC9cEs71xHIoq0upAi/rav/sZh0MdPl2BLEZo3ZvQqnofscgDo8IfqMzIDRw1SCg1w7d7eNJxINx+fKqorwXKqSM2YPntVJQ+WYo9Ct0Xi31kEpC8wP5lbX4Chz8kR0Vn1unBE5jeZbNg==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed)\n header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;",
        "From": "Bing Zhao <bingz@nvidia.com>",
        "To": "<viacheslavo@nvidia.com>, <matan@nvidia.com>",
        "CC": "<dev@dpdk.org>, <orika@nvidia.com>, <rasland@nvidia.com>,\n <thomas@monjalon.net>, <lizh@nvidia.com>, <shunh@nvidia.com>",
        "Date": "Wed, 21 Jul 2021 11:54:17 +0300",
        "Message-ID": "<20210721085421.13111-4-bingz@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210721085421.13111-1-bingz@nvidia.com>",
        "References": "<20210705155756.21443-1-bingz@nvidia.com>\n <20210721085421.13111-1-bingz@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[172.20.187.5]",
        "X-ClientProxiedBy": "HQMAIL101.nvidia.com (172.20.187.10) To\n HQMAIL107.nvidia.com (172.20.187.13)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "d0950fac-d2fa-4dd5-714d-08d94c25305e",
        "X-MS-TrafficTypeDiagnostic": "BY5PR12MB3825:",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BY5PR12MB382566EFE8532D563ABDD0B4D0E39@BY5PR12MB3825.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:7691;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n o2gg7F7KEZfvYFNDaBKBJjKLkGmO6/SG+WSUjHwWPpE4FOiC8FbkobB9TeDObSFXc6PL/SKQiHbiK4U23qxYeT5QhcSOJg/dTNRbG6hYiSvQuGJ1JJyxHEAJgZm9N2w/tkypnUQ93eshl4ayVlZNrhF4lPVKAjZVgKedBBGJbqPGPSTPI5DhEz5oizBgns9eFUWLj98G9gttyiSTG74A8Ge6CRUsl/sTnPEBXQeWyAleg+wzYx/vPG5W+/sfz/4iJXh44yA2uOgx3z0get9djTYsTs13qsccvoh+a/jSihU9g+QersNn7KULwScLuBypvQJyAVnxf0mJKXJeTXpa/Wp2HwfbPvbxHA5+2u8ff2xQR6xhs1aHoXYW6DF/T1T4vPoPZmVcbt4juBzDpmfoRoHgSe3ofZFqtK+7AgrY1ITHWVlcuVILV4ZpnxxD1NRCnmpNuZz8ic0o0yfkVukFUIkRMpKIB8/WWezZsYkUVzLPN0jpsQA71UdegAsYb5wm1GuKnRLXU9krKB6UoQ0BZlJ4Rt7N0kHRFvanZFeFBm9GpdZtgt2XTzBV0H817TJXMzSv92l0OP3BJTg4cIU5ygGLi5Caj2uHLXRcpP249SdHzEj5+K2xYH//95W6FJjYQZlg8RkWm/ppzPxXA3li+bkRqO0/vFpyOu0erAVaEz8b0ZM8rDbmhV16tWbg0ENmA3MFFblRX7kmH6OK7sE00A==",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(376002)(396003)(39860400002)(346002)(136003)(36840700001)(46966006)(336012)(86362001)(4326008)(6286002)(6666004)(70586007)(8936002)(8676002)(36860700001)(2616005)(426003)(6636002)(316002)(55016002)(16526019)(26005)(478600001)(7696005)(110136005)(47076005)(36756003)(70206006)(82310400003)(54906003)(107886003)(82740400003)(36906005)(5660300002)(2906002)(186003)(1076003)(83380400001)(356005)(30864003)(7636003);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "21 Jul 2021 08:54:45.6643 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n d0950fac-d2fa-4dd5-714d-08d94c25305e",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT038.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BY5PR12MB3825",
        "Subject": "[dpdk-dev] [PATCH v3 3/7] net/mlx5: added support for yellow policy\n rules",
        "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": "When creating a meter policy, both / either of the action rules for\ngreen and yellow colors may be provided. After validation, usually\nthe actions are created before the meter is using by a flow rule.\n\nIf there is action specified for the yellow color, the action rules\nshould be created together with green color in the same time. The\naction of green / yellow color can be empty, then the default\nbehavior is the jump action of the rule, just the same as that of\nthe default policy.\n\nIf the fate action of either one color is queue / RSS, all the\nactions rules will be created on the flow splitting stage instead of\nthe policy adding stage.\n\nSigned-off-by: Bing Zhao <bingz@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow_dv.c    | 46 ++++++++++++++-------------\n drivers/net/mlx5/mlx5_flow_meter.c | 50 +++++++++++++++++++-----------\n 2 files changed, 56 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex cfc646c5e5..2400565232 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -15214,7 +15214,7 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct rte_flow_error flow_err;\n \tconst struct rte_flow_action *act;\n-\tuint64_t action_flags = 0;\n+\tuint64_t action_flags;\n \tstruct mlx5_flow_handle dh;\n \tstruct mlx5_flow dev_flow;\n \tstruct mlx5_flow_dv_port_id_action_resource port_id_action;\n@@ -15234,21 +15234,20 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\n \tmemset(&dh, 0, sizeof(struct mlx5_flow_handle));\n \tmemset(&dev_flow, 0, sizeof(struct mlx5_flow));\n \tmemset(&port_id_action, 0,\n-\t\tsizeof(struct mlx5_flow_dv_port_id_action_resource));\n+\t       sizeof(struct mlx5_flow_dv_port_id_action_resource));\n \tmemset(mhdr_res, 0, sizeof(*mhdr_res));\n \tmhdr_res->ft_type = transfer ? MLX5DV_FLOW_TABLE_TYPE_FDB :\n-\t\t\t\t\tegress ?\n-\t\t\t\t\tMLX5DV_FLOW_TABLE_TYPE_NIC_TX :\n-\t\t\t\t\tMLX5DV_FLOW_TABLE_TYPE_NIC_RX;\n+\t\t\t\t       (egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX :\n+\t\t\t\t\tMLX5DV_FLOW_TABLE_TYPE_NIC_RX);\n \tdev_flow.handle = &dh;\n \tdev_flow.dv.port_id_action = &port_id_action;\n \tdev_flow.external = true;\n \tfor (i = 0; i < RTE_COLORS; i++) {\n \t\tif (i < MLX5_MTR_RTE_COLORS)\n \t\t\tact_cnt = &mtr_policy->act_cnt[i];\n+\t\taction_flags = 0;\n \t\tfor (act = actions[i];\n-\t\t\tact && act->type != RTE_FLOW_ACTION_TYPE_END;\n-\t\t\tact++) {\n+\t\t     act && act->type != RTE_FLOW_ACTION_TYPE_END; act++) {\n \t\t\tswitch (act->type) {\n \t\t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\t\t{\n@@ -15456,7 +15455,7 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\n \t\t\t\t\t(1 << MLX5_SCALE_FLOW_GROUP_BIT),\n \t\t\t\t};\n \t\t\t\tstruct mlx5_flow_meter_sub_policy *sub_policy =\n-\t\t\t\tmtr_policy->sub_policys[domain][0];\n+\t\t\t\t\tmtr_policy->sub_policys[domain][0];\n \n \t\t\t\tif (i >= MLX5_MTR_RTE_COLORS)\n \t\t\t\t\treturn -rte_mtr_error_set(error,\n@@ -15500,6 +15499,10 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\n \t\t\t\taction_flags |= MLX5_FLOW_ACTION_JUMP;\n \t\t\t\tbreak;\n \t\t\t}\n+\t\t\t/*\n+\t\t\t * No need to check meter hierarchy for Y or R colors\n+\t\t\t * here since it is done in the validation stage.\n+\t\t\t */\n \t\t\tcase RTE_FLOW_ACTION_TYPE_METER:\n \t\t\t{\n \t\t\t\tconst struct rte_flow_action_meter *mtr;\n@@ -15615,6 +15618,7 @@ flow_dv_create_mtr_policy_acts(struct rte_eth_dev *dev,\n \t\t\tret = __flow_dv_create_domain_policy_acts(dev,\n \t\t\t\tmtr_policy, actions,\n \t\t\t\t(enum mlx5_meter_domain)i, error);\n+\t\t\t/* Cleaning resource is done in the caller level. */\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n \t\t}\n@@ -16156,16 +16160,15 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \n \tfor (i = 0; i < RTE_COLORS; i++) {\n \t\tacts[i].actions_n = 0;\n-\t\tif (i == RTE_COLOR_YELLOW)\n-\t\t\tcontinue;\n \t\tif (i == RTE_COLOR_RED) {\n \t\t\t/* Only support drop on red. */\n \t\t\tacts[i].dv_actions[0] =\n-\t\t\tmtr_policy->dr_drop_action[domain];\n+\t\t\t\tmtr_policy->dr_drop_action[domain];\n \t\t\tacts[i].actions_n = 1;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (mtr_policy->act_cnt[i].fate_action == MLX5_FLOW_FATE_MTR) {\n+\t\tif (i == RTE_COLOR_GREEN &&\n+\t\t    mtr_policy->act_cnt[i].fate_action == MLX5_FLOW_FATE_MTR) {\n \t\t\tstruct rte_flow_attr attr = {\n \t\t\t\t.transfer = transfer\n \t\t\t};\n@@ -16199,13 +16202,12 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \t\t\t\t\"mark action for policy.\");\n \t\t\t\tgoto err_exit;\n \t\t\t}\n-\t\t\tacts[i].dv_actions[acts[i].actions_n] =\n-\t\t\t\t\t\ttag->action;\n+\t\t\tacts[i].dv_actions[acts[i].actions_n] = tag->action;\n \t\t\tacts[i].actions_n++;\n \t\t}\n \t\tif (mtr_policy->act_cnt[i].modify_hdr) {\n \t\t\tacts[i].dv_actions[acts[i].actions_n] =\n-\t\t\tmtr_policy->act_cnt[i].modify_hdr->action;\n+\t\t\t\tmtr_policy->act_cnt[i].modify_hdr->action;\n \t\t\tacts[i].actions_n++;\n \t\t}\n \t\tif (mtr_policy->act_cnt[i].fate_action) {\n@@ -16220,7 +16222,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \t\t\t\t\tgoto err_exit;\n \t\t\t\t}\n \t\t\t\tacts[i].dv_actions[acts[i].actions_n] =\n-\t\t\t\tport_action->action;\n+\t\t\t\t\tport_action->action;\n \t\t\t\tacts[i].actions_n++;\n \t\t\t\tmtr_policy->dev = dev;\n \t\t\t\tmatch_src_port = true;\n@@ -16234,15 +16236,15 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \t\t\tcase MLX5_FLOW_FATE_SHARED_RSS:\n \t\t\tcase MLX5_FLOW_FATE_QUEUE:\n \t\t\t\thrxq = mlx5_ipool_get\n-\t\t\t\t(priv->sh->ipool[MLX5_IPOOL_HRXQ],\n-\t\t\t\tsub_policy->rix_hrxq[i]);\n+\t\t\t\t\t(priv->sh->ipool[MLX5_IPOOL_HRXQ],\n+\t\t\t\t\t sub_policy->rix_hrxq[i]);\n \t\t\t\tif (!hrxq) {\n \t\t\t\t\tDRV_LOG(ERR, \"Failed to find \"\n \t\t\t\t\t\t\"queue action for policy.\");\n \t\t\t\t\tgoto err_exit;\n \t\t\t\t}\n \t\t\t\tacts[i].dv_actions[acts[i].actions_n] =\n-\t\t\t\thrxq->action;\n+\t\t\t\t\thrxq->action;\n \t\t\t\tacts[i].actions_n++;\n \t\t\t\tbreak;\n \t\t\tcase MLX5_FLOW_FATE_MTR:\n@@ -16284,7 +16286,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \tif (__flow_dv_create_domain_policy_rules(dev, sub_policy,\n \t\t\t\tegress, transfer, match_src_port, acts)) {\n \t\tDRV_LOG(ERR,\n-\t\t\"Failed to create policy rules per domain.\");\n+\t\t\t\"Failed to create policy rules per domain.\");\n \t\tgoto err_exit;\n \t}\n \treturn 0;\n@@ -16321,8 +16323,8 @@ flow_dv_create_policy_rules(struct rte_eth_dev *dev,\n \t\t/* Prepare actions list and create policy rules. */\n \t\tif (__flow_dv_create_policy_acts_rules(dev, mtr_policy,\n \t\t\tmtr_policy->sub_policys[i][0], i)) {\n-\t\t\tDRV_LOG(ERR,\n-\t\t\t\"Failed to create policy action list per domain.\");\n+\t\t\tDRV_LOG(ERR, \"Failed to create policy action \"\n+\t\t\t\t\"list per domain.\");\n \t\t\treturn -1;\n \t\t}\n \t}\ndiff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c\nindex 73eba0dabd..19b2665558 100644\n--- a/drivers/net/mlx5/mlx5_flow_meter.c\n+++ b/drivers/net/mlx5/mlx5_flow_meter.c\n@@ -686,21 +686,20 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \tif (!priv->mtr_en)\n \t\treturn -rte_mtr_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_MTR_ERROR_TYPE_METER_POLICY,\n-\t\t\t\t\t  NULL, \"meter policy unsupported.\");\n+\t\t\t\t\t  NULL, \"meter policy unsupported. \");\n \tif (policy_id == MLX5_INVALID_POLICY_ID)\n \t\treturn -rte_mtr_error_set(error, ENOTSUP,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID, NULL,\n-\t\t\t\"policy ID is invalid. \");\n+\t\t\t\t\t  RTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n+\t\t\t\t\t  NULL, \"policy ID is invalid. \");\n \tif (policy_id == priv->sh->mtrmng->def_policy_id)\n \t\treturn -rte_mtr_error_set(error, EEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID, NULL,\n-\t\t\t\"policy ID exists. \");\n-\tmtr_policy = mlx5_flow_meter_policy_find(dev, policy_id,\n-\t\t\t\t&policy_idx);\n+\t\t\t\t\t  RTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n+\t\t\t\t\t  NULL, \"default policy ID exists. \");\n+\tmtr_policy = mlx5_flow_meter_policy_find(dev, policy_id, &policy_idx);\n \tif (mtr_policy)\n \t\treturn -rte_mtr_error_set(error, EEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID, NULL,\n-\t\t\t\"policy ID exists. \");\n+\t\t\t\t\t  RTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n+\t\t\t\t\t  NULL, \"policy ID exists. \");\n \tret = mlx5_flow_validate_mtr_acts(dev, policy->actions, &attr,\n \t\t\t&is_rss, &domain_bitmap, &is_def_policy, error);\n \tif (ret)\n@@ -730,16 +729,22 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \tfor (i = 0; i < MLX5_MTR_DOMAIN_MAX; i++) {\n \t\tif (!(domain_bitmap & (1 << i)))\n \t\t\tcontinue;\n+\t\t/*\n+\t\t * If RSS is found, it means that only the ingress domain can\n+\t\t * be supported. It is invalid to support RSS for one color\n+\t\t * and egress / transfer domain actions for another. Drop and\n+\t\t * jump action should have no impact.\n+\t\t */\n \t\tif (is_rss) {\n \t\t\tpolicy_size +=\n-\t\t\tsizeof(struct mlx5_flow_meter_sub_policy *) *\n-\t\t\tMLX5_MTR_RSS_MAX_SUB_POLICY;\n+\t\t\t\tsizeof(struct mlx5_flow_meter_sub_policy *) *\n+\t\t\t\tMLX5_MTR_RSS_MAX_SUB_POLICY;\n \t\t\tbreak;\n \t\t}\n \t\tpolicy_size += sizeof(struct mlx5_flow_meter_sub_policy *);\n \t}\n \tmtr_policy = mlx5_malloc(MLX5_MEM_ZERO, policy_size,\n-\t\t\t RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n+\t\t\t\t RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n \tif (!mtr_policy)\n \t\treturn -rte_mtr_error_set(error, ENOMEM,\n \t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY, NULL,\n@@ -756,10 +761,9 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \t\t\tmtr_policy->transfer = 1;\n \t\tsub_policy = mlx5_ipool_zmalloc\n \t\t\t\t(priv->sh->ipool[MLX5_IPOOL_MTR_POLICY],\n-\t\t\t\t&sub_policy_idx);\n-\t\tif (!sub_policy)\n-\t\t\tgoto policy_add_err;\n-\t\tif (sub_policy_idx > MLX5_MAX_SUB_POLICY_TBL_NUM)\n+\t\t\t\t &sub_policy_idx);\n+\t\tif (!sub_policy ||\n+\t\t    sub_policy_idx > MLX5_MAX_SUB_POLICY_TBL_NUM)\n \t\t\tgoto policy_add_err;\n \t\tsub_policy->idx = sub_policy_idx;\n \t\tsub_policy->main_policy = mtr_policy;\n@@ -768,7 +772,7 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \t\t\tsub_policy->main_policy_id = 1;\n \t\t}\n \t\tmtr_policy->sub_policys[i] =\n-\t\t(struct mlx5_flow_meter_sub_policy **)\n+\t\t\t(struct mlx5_flow_meter_sub_policy **)\n \t\t\t((uint8_t *)mtr_policy + policy_size);\n \t\tmtr_policy->sub_policys[i][0] = sub_policy;\n \t\tsub_policy_num = (mtr_policy->sub_policy_num >>\n@@ -780,11 +784,17 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \t\tmtr_policy->sub_policy_num |=\n \t\t\t(sub_policy_num & MLX5_MTR_SUB_POLICY_NUM_MASK) <<\n \t\t\t(MLX5_MTR_SUB_POLICY_NUM_SHIFT * i);\n+\t\t/*\n+\t\t * If RSS is found, it means that only the ingress domain can\n+\t\t * be supported. It is invalid to support RSS for one color\n+\t\t * and egress / transfer domain actions for another. Drop and\n+\t\t * jump action should have no impact.\n+\t\t */\n \t\tif (is_rss) {\n \t\t\tmtr_policy->is_rss = 1;\n \t\t\tbreak;\n \t\t}\n-\t\tpolicy_size += sizeof(struct mlx5_flow_meter_sub_policy  *);\n+\t\tpolicy_size += sizeof(struct mlx5_flow_meter_sub_policy *);\n \t}\n \trte_spinlock_init(&mtr_policy->sl);\n \tret = mlx5_flow_create_mtr_acts(dev, mtr_policy,\n@@ -800,6 +810,10 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \t\t\tgoto policy_add_err;\n \t\tskip_rule = (final_policy->is_rss || final_policy->is_queue);\n \t}\n+\t/*\n+\t * If either Green or Yellow has queue / RSS action, all the policy\n+\t * rules will be created later in the flow splitting stage.\n+\t */\n \tif (!is_rss && !mtr_policy->is_queue && !skip_rule) {\n \t\t/* Create policy rules in HW. */\n \t\tret = mlx5_flow_create_policy_rules(dev, mtr_policy);\n",
    "prefixes": [
        "v3",
        "3/7"
    ]
}