get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96020,
    "url": "http://patchwork.dpdk.org/api/patches/96020/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210718171817.23822-5-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": "<20210718171817.23822-5-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210718171817.23822-5-bingz@nvidia.com",
    "date": "2021-07-18T17:18:14",
    "name": "[v2,4/7] net/mlx5: split policies handling of colors",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b4475838f7637ea3b6664c1b7fbb771fd48ec328",
    "submitter": {
        "id": 1976,
        "url": "http://patchwork.dpdk.org/api/people/1976/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patchwork.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210718171817.23822-5-bingz@nvidia.com/mbox/",
    "series": [
        {
            "id": 17883,
            "url": "http://patchwork.dpdk.org/api/series/17883/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17883",
            "date": "2021-07-18T17:18:10",
            "name": "support yellow color policy in mlx5",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/17883/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96020/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96020/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 6A6B0A0C46;\n\tSun, 18 Jul 2021 19:19:21 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 31E2241195;\n\tSun, 18 Jul 2021 19:19:10 +0200 (CEST)",
            "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49])\n by mails.dpdk.org (Postfix) with ESMTP id 89A5E41192\n for <dev@dpdk.org>; Sun, 18 Jul 2021 19:19:08 +0200 (CEST)",
            "from BN6PR14CA0025.namprd14.prod.outlook.com (2603:10b6:404:13f::11)\n by BY5PR12MB4068.namprd12.prod.outlook.com (2603:10b6:a03:203::12)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Sun, 18 Jul\n 2021 17:19:04 +0000",
            "from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com\n (2603:10b6:404:13f:cafe::c) by BN6PR14CA0025.outlook.office365.com\n (2603:10b6:404:13f::11) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend\n Transport; Sun, 18 Jul 2021 17:19:04 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4331.21 via Frontend Transport; Sun, 18 Jul 2021 17:19:04 +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; Sun, 18 Jul\n 2021 17:19:01 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=Vxv3wR2UaYfhjGsvhU9hejAxxQWv+j9gYKtLVm0gtR63SxF+wXxVoLNdwPCo+BKsVIf48O7/4lKwMdbts3m1En8po+6xoY1n4dYyppmfPbe6dgyGiGPe5/bCelpxHz71jTrPi6xi5oiAcitVq/6+/bA+RXCnDtjxQ0WV8PJuW+GPBFG4jxhP+QBHpD1mQVhQGTMwRa4WoEIDRjoTxGbMXeHpYx6sSSOKzFBEm1IhwuyIazfzs74duPCfxzjQmMev9hur5K1Az1zI1hd35O+kJ5LNwJFmW3pkhYif1oYnhjssCya5AxjfcMlS7A3lXMMp7OrTXSkSAOQuFWdVlpzDcQ==",
        "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=5v+DrUR4Fulv2w5ZD3sgvKj/nwJNf3HflQen24qwwNo=;\n b=VHNy8xRN2sXBKYsd6MQVnRXvrsb5YDFLAQKO38iXJLvSgPEnlQOmoqrEoWZgw0qOaYyflvVcFVKhfEFUgsE2WdUOAxOh1V1DPuokMc/iqexfauOo6qln0dVFS8OtRV5yOjonh1S+yBSx6zL5ML7pdJXadv/kStFYBFrWYKIjTZtWa1F9cdYb7HLxBe4zgAnIlQbo1ZVHTVD8Xkdc5kvJmg2RZgZP0OcktcTtUaqpI3NtKWGYG6sLMg/htcyC7TDj96GA11pD22PS18IRR/7kDNw3DdAjrWatGeZAynevFuDcZlXsPPHyFGpkhsfbrc1WFZazmkKOU+LfkVgUfVOimw==",
        "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=5v+DrUR4Fulv2w5ZD3sgvKj/nwJNf3HflQen24qwwNo=;\n b=IjgF4so1TT98YTdvCgtu/D+8qNwUkWu7NR3T3kMDXvL7NShQxcfaQWvKQMxLanNlclbYA6o6nyyfGbDYh1EX9s7+LXTQrZndWCEq9fQ/BqalMeIr7508HNojxZZLZ3PFLAnzMO6YfghdfMexRqs+YwpznSxqrPGnepKEP92bOTdL4QLh7QmAy6YQeLhBUEniPdM8U/CfcyqSAappGqm8O+Hy+SW/g1/ABcfdC1P8Yxf/1nP+S3E4e9rNiEOJl0z+mGBbW8vB3Y9jVClmyb66h15MMnRHzxOWayvY1AumU5voijWIELl3yb3rUuwJ/irE92CwZVXeyahF7t9hSWo6iA==",
        "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": "Sun, 18 Jul 2021 20:18:14 +0300",
        "Message-ID": "<20210718171817.23822-5-bingz@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210718171817.23822-1-bingz@nvidia.com>",
        "References": "<20210705155756.21443-1-bingz@nvidia.com>\n <20210718171817.23822-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": "HQMAIL107.nvidia.com (172.20.187.13) To\n HQMAIL107.nvidia.com (172.20.187.13)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "162076ae-7ec1-4cef-751a-08d94a1024a7",
        "X-MS-TrafficTypeDiagnostic": "BY5PR12MB4068:",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BY5PR12MB406897BF4CD89E339A5A1C15D0E09@BY5PR12MB4068.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:3968;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n aaQ2HVJHlRebnCDErVQ3fiHmrNgEloGf1TdKF0KybpjlIdl6EnlkZLZ48EY1a73cRyjfEL5DwOb3vKxqoKowJUbYdOf4dmLPEuFmVhmSf6tvMZPq69AluHNfUdE8+/JvppypRSZVdzf1UQZRYD0Rndup2EZFkT656QwcnRkqg4igOMJ5OsJ8AZIvpoSh8P6EH1zYNL2F2vOezck3TZ2rPr0bqlr9kFlcPNxaNEHyQ2KqfGC+et30RdPUu2/nXgWQfO7w8bsS+1wSHius6z2TvPVOMNjlAPLLAUPbHHyNiizEF09UhCbSloQUHda37uNL9IZoERxYSqBP2MtSYIEY1oYWZFNn1i8ESzWi7/zZTllF2cZrtxZk7POBeJi/enbclegNbCe2eLIP5heDpjQztoAglr5zVeYlZJ9kxjyp9j2B/rwDiM+KeR070Giy5AmCvvcLQWNHvcq32vqiexKlA2L2WVR4u9ZYhx5rSQRCWbOgKWm2muUOlbaAV9+8zoiRBGTwcNPGMdJjofzi7SCxO+8jdXdSfEHtc4jorwsgFEUf52hJeiRYHjuGay1zRg74g/W3+ahhcXRqBmpnG8b0c2iYPKBQmQRtQ42CoUdBs0/NFKZUfNRzRECYtjkv5mQzlYZ/0e76uOjgOGKeuGYRLHPoCPkJtawMakLwqYTU9/B+lvb3X3jBk1ogXnhTUxqJE/qevBitPdRFRp0r2vV1TPv0JTnhFWFdvjo8Q1HKOEA=",
        "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)(46966006)(36840700001)(316002)(70586007)(110136005)(55016002)(47076005)(70206006)(426003)(34020700004)(54906003)(2616005)(8676002)(2906002)(36756003)(6636002)(8936002)(508600001)(82310400003)(36906005)(4326008)(336012)(30864003)(83380400001)(16526019)(1076003)(186003)(356005)(86362001)(36860700001)(5660300002)(6666004)(107886003)(7636003)(6286002)(26005)(7696005);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Jul 2021 17:19:04.2713 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 162076ae-7ec1-4cef-751a-08d94a1024a7",
        "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 BN8NAM11FT042.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BY5PR12MB4068",
        "Subject": "[dpdk-dev] [PATCH v2 4/7] net/mlx5: split policies handling of\n colors",
        "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": "If the fate action is either RSS or Queue of a meter policy, the\naction will only be created in the flow splitting stage. With queue\nas the fate action, only one sub-policy is needed. And RSS will\nhave more than one sub-policies if there is an expansion.\n\nSince the RSS parameters are the same for both green and yellow\ncolors except the queues, the expansion result will be unique.\nEven if only one color has the RSS action, the checking and possible\nexpansion will be done then. For each sub-policy, the action rules\nneed to be created separately on its own policy table.\n\nSigned-off-by: Bing Zhao <bingz@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.c    | 40 ++++++++++----------\n drivers/net/mlx5/mlx5_flow_dv.c | 67 +++++++++++++++++----------------\n 2 files changed, 55 insertions(+), 52 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 347e8c1a09..d90c8cd314 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -4687,7 +4687,7 @@ get_meter_sub_policy(struct rte_eth_dev *dev,\n \t\tstruct mlx5_flow_rss_desc *rss_desc[MLX5_MTR_RTE_COLORS] = {0};\n \t\tuint32_t i;\n \n-\t\t/**\n+\t\t/*\n \t\t * This is a tmp dev_flow,\n \t\t * no need to register any matcher for it in translate.\n \t\t */\n@@ -4695,18 +4695,19 @@ get_meter_sub_policy(struct rte_eth_dev *dev,\n \t\tfor (i = 0; i < MLX5_MTR_RTE_COLORS; i++) {\n \t\t\tstruct mlx5_flow dev_flow = {0};\n \t\t\tstruct mlx5_flow_handle dev_handle = { {0} };\n+\t\t\tuint8_t fate = final_policy->act_cnt[i].fate_action;\n \n-\t\t\tif (final_policy->is_rss) {\n+\t\t\tif (fate == MLX5_FLOW_FATE_SHARED_RSS) {\n \t\t\t\tconst void *rss_act =\n \t\t\t\t\tfinal_policy->act_cnt[i].rss->conf;\n \t\t\t\tstruct rte_flow_action rss_actions[2] = {\n \t\t\t\t\t[0] = {\n \t\t\t\t\t.type = RTE_FLOW_ACTION_TYPE_RSS,\n-\t\t\t\t\t.conf = rss_act\n+\t\t\t\t\t.conf = rss_act,\n \t\t\t\t\t},\n \t\t\t\t\t[1] = {\n \t\t\t\t\t.type = RTE_FLOW_ACTION_TYPE_END,\n-\t\t\t\t\t.conf = NULL\n+\t\t\t\t\t.conf = NULL,\n \t\t\t\t\t}\n \t\t\t\t};\n \n@@ -4731,9 +4732,10 @@ get_meter_sub_policy(struct rte_eth_dev *dev,\n \t\t\t\t\t\trss_desc_v[i].hash_fields ?\n \t\t\t\t\t\trss_desc_v[i].queue_num : 1;\n \t\t\t\trss_desc_v[i].tunnel =\n-\t\t\t\t\t!!(dev_flow.handle->layers &\n-\t\t\t\t\tMLX5_FLOW_LAYER_TUNNEL);\n-\t\t\t} else {\n+\t\t\t\t\t\t!!(dev_flow.handle->layers &\n+\t\t\t\t\t\t   MLX5_FLOW_LAYER_TUNNEL);\n+\t\t\t\trss_desc[i] = &rss_desc_v[i];\n+\t\t\t} else if (fate == MLX5_FLOW_FATE_QUEUE) {\n \t\t\t\t/* This is queue action. */\n \t\t\t\trss_desc_v[i] = wks->rss_desc;\n \t\t\t\trss_desc_v[i].key_len = 0;\n@@ -4741,24 +4743,24 @@ get_meter_sub_policy(struct rte_eth_dev *dev,\n \t\t\t\trss_desc_v[i].queue =\n \t\t\t\t\t&final_policy->act_cnt[i].queue;\n \t\t\t\trss_desc_v[i].queue_num = 1;\n+\t\t\t\trss_desc[i] = &rss_desc_v[i];\n+\t\t\t} else {\n+\t\t\t\trss_desc[i] = NULL;\n \t\t\t}\n-\t\t\trss_desc[i] = &rss_desc_v[i];\n \t\t}\n \t\tsub_policy = flow_drv_meter_sub_policy_rss_prepare(dev,\n \t\t\t\t\t\tflow, policy, rss_desc);\n \t} else {\n \t\tenum mlx5_meter_domain mtr_domain =\n \t\t\tattr->transfer ? MLX5_MTR_DOMAIN_TRANSFER :\n-\t\t\t\tattr->egress ? MLX5_MTR_DOMAIN_EGRESS :\n-\t\t\t\t\tMLX5_MTR_DOMAIN_INGRESS;\n+\t\t\t\t(attr->egress ? MLX5_MTR_DOMAIN_EGRESS :\n+\t\t\t\t\t\tMLX5_MTR_DOMAIN_INGRESS);\n \t\tsub_policy = policy->sub_policys[mtr_domain][0];\n \t}\n-\tif (!sub_policy) {\n+\tif (!sub_policy)\n \t\trte_flow_error_set(error, EINVAL,\n-\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n-\t\t\t\"Failed to get meter sub-policy.\");\n-\t\tgoto exit;\n-\t}\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n+\t\t\t\t   \"Failed to get meter sub-policy.\");\n exit:\n \treturn sub_policy;\n }\n@@ -4956,8 +4958,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,\n \t\t} else {\n \t\t\tenum mlx5_meter_domain mtr_domain =\n \t\t\tattr->transfer ? MLX5_MTR_DOMAIN_TRANSFER :\n-\t\t\t\tattr->egress ? MLX5_MTR_DOMAIN_EGRESS :\n-\t\t\t\t\tMLX5_MTR_DOMAIN_INGRESS;\n+\t\t\t\t(attr->egress ? MLX5_MTR_DOMAIN_EGRESS :\n+\t\t\t\t\t\tMLX5_MTR_DOMAIN_INGRESS);\n \n \t\t\tsub_policy =\n \t\t\t&priv->sh->mtrmng->def_policy[mtr_domain]->sub_policy;\n@@ -4973,8 +4975,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,\n \tactions_pre++;\n \tif (!tag_action)\n \t\treturn rte_flow_error_set(error, ENOMEM,\n-\t\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n-\t\t\t\t\t\"No tag action space.\");\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t\t  NULL, \"No tag action space.\");\n \tif (!mtr_flow_id) {\n \t\ttag_action->type = RTE_FLOW_ACTION_TYPE_VOID;\n \t\tgoto exit;\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex ffe97d453a..c617e8801a 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -15070,11 +15070,11 @@ __flow_dv_destroy_sub_policy_rules(struct rte_eth_dev *dev,\n \t\t\t\t   next_port, tmp) {\n \t\t\tclaim_zero(mlx5_flow_os_destroy_flow(color_rule->rule));\n \t\t\ttbl = container_of(color_rule->matcher->tbl,\n-\t\t\t\t\ttypeof(*tbl), tbl);\n+\t\t\t\t\t   typeof(*tbl), tbl);\n \t\t\tmlx5_list_unregister(tbl->matchers,\n-\t\t\t\t\t\t&color_rule->matcher->entry);\n+\t\t\t\t\t     &color_rule->matcher->entry);\n \t\t\tTAILQ_REMOVE(&sub_policy->color_rules[i],\n-\t\t\t\t\tcolor_rule, next_port);\n+\t\t\t\t     color_rule, next_port);\n \t\t\tmlx5_free(color_rule);\n \t\t\tif (next_fm)\n \t\t\t\tmlx5_flow_meter_detach(priv, next_fm);\n@@ -15088,13 +15088,13 @@ __flow_dv_destroy_sub_policy_rules(struct rte_eth_dev *dev,\n \t\t}\n \t\tif (sub_policy->jump_tbl[i]) {\n \t\t\tflow_dv_tbl_resource_release(MLX5_SH(dev),\n-\t\t\tsub_policy->jump_tbl[i]);\n+\t\t\t\t\t\t     sub_policy->jump_tbl[i]);\n \t\t\tsub_policy->jump_tbl[i] = NULL;\n \t\t}\n \t}\n \tif (sub_policy->tbl_rsc) {\n \t\tflow_dv_tbl_resource_release(MLX5_SH(dev),\n-\t\t\tsub_policy->tbl_rsc);\n+\t\t\t\t\t     sub_policy->tbl_rsc);\n \t\tsub_policy->tbl_rsc = NULL;\n \t}\n }\n@@ -15111,7 +15111,7 @@ __flow_dv_destroy_sub_policy_rules(struct rte_eth_dev *dev,\n  */\n static void\n flow_dv_destroy_policy_rules(struct rte_eth_dev *dev,\n-\t\t      struct mlx5_flow_meter_policy *mtr_policy)\n+\t\t\t     struct mlx5_flow_meter_policy *mtr_policy)\n {\n \tuint32_t i, j;\n \tstruct mlx5_flow_meter_sub_policy *sub_policy;\n@@ -15124,8 +15124,8 @@ flow_dv_destroy_policy_rules(struct rte_eth_dev *dev,\n \t\tfor (j = 0; j < sub_policy_num; j++) {\n \t\t\tsub_policy = mtr_policy->sub_policys[i][j];\n \t\t\tif (sub_policy)\n-\t\t\t\t__flow_dv_destroy_sub_policy_rules\n-\t\t\t\t\t\t(dev, sub_policy);\n+\t\t\t\t__flow_dv_destroy_sub_policy_rules(dev,\n+\t\t\t\t\t\t\t\t   sub_policy);\n \t\t}\n \t}\n }\n@@ -16162,6 +16162,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,\n \tbool match_src_port = false;\n \tint i;\n \n+\t/* If RSS or Queue, no previous actions / rules is created. */\n \tfor (i = 0; i < RTE_COLORS; i++) {\n \t\tacts[i].actions_n = 0;\n \t\tif (i == RTE_COLOR_RED) {\n@@ -16661,37 +16662,36 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev,\n \tsub_policy_num = (mtr_policy->sub_policy_num >>\n \t\t\t(MLX5_MTR_SUB_POLICY_NUM_SHIFT * domain)) &\n \t\t\tMLX5_MTR_SUB_POLICY_NUM_MASK;\n-\tfor (i = 0; i < sub_policy_num;\n-\t\ti++) {\n-\t\tfor (j = 0; j < MLX5_MTR_RTE_COLORS; j++) {\n-\t\t\tif (rss_desc[j] &&\n-\t\t\t\thrxq_idx[j] !=\n-\t\t\tmtr_policy->sub_policys[domain][i]->rix_hrxq[j])\n+\tfor (j = 0; j < sub_policy_num; j++) {\n+\t\tfor (i = 0; i < MLX5_MTR_RTE_COLORS; i++) {\n+\t\t\tif (rss_desc[i] &&\n+\t\t\t    hrxq_idx[i] !=\n+\t\t\t    mtr_policy->sub_policys[domain][j]->rix_hrxq[i])\n \t\t\t\tbreak;\n \t\t}\n-\t\tif (j >= MLX5_MTR_RTE_COLORS) {\n+\t\tif (i >= MLX5_MTR_RTE_COLORS) {\n \t\t\t/*\n \t\t\t * Found the sub policy table with\n-\t\t\t * the same queue per color\n+\t\t\t * the same queue per color.\n \t\t\t */\n \t\t\trte_spinlock_unlock(&mtr_policy->sl);\n-\t\t\tfor (j = 0; j < MLX5_MTR_RTE_COLORS; j++)\n-\t\t\t\tmlx5_hrxq_release(dev, hrxq_idx[j]);\n+\t\t\tfor (i = 0; i < MLX5_MTR_RTE_COLORS; i++)\n+\t\t\t\tmlx5_hrxq_release(dev, hrxq_idx[i]);\n \t\t\t*is_reuse = true;\n-\t\t\treturn mtr_policy->sub_policys[domain][i];\n+\t\t\treturn mtr_policy->sub_policys[domain][j];\n \t\t}\n \t}\n \t/* Create sub policy. */\n \tif (!mtr_policy->sub_policys[domain][0]->rix_hrxq[0]) {\n-\t\t/* Reuse the first dummy sub_policy*/\n+\t\t/* Reuse the first pre-allocated sub_policy. */\n \t\tsub_policy = mtr_policy->sub_policys[domain][0];\n \t\tsub_policy_idx = sub_policy->idx;\n \t} else {\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\t\t\t &sub_policy_idx);\n \t\tif (!sub_policy ||\n-\t\t\tsub_policy_idx > MLX5_MAX_SUB_POLICY_TBL_NUM) {\n+\t\t    sub_policy_idx > MLX5_MAX_SUB_POLICY_TBL_NUM) {\n \t\t\tfor (i = 0; i < MLX5_MTR_RTE_COLORS; i++)\n \t\t\t\tmlx5_hrxq_release(dev, hrxq_idx[i]);\n \t\t\tgoto rss_sub_policy_error;\n@@ -16713,9 +16713,9 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev,\n \t\t\t * RSS action to Queue action.\n \t\t\t */\n \t\t\thrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],\n-\t\t\t\thrxq_idx[i]);\n+\t\t\t\t\t      hrxq_idx[i]);\n \t\t\tif (!hrxq) {\n-\t\t\t\tDRV_LOG(ERR, \"Failed to create policy hrxq\");\n+\t\t\t\tDRV_LOG(ERR, \"Failed to get policy hrxq\");\n \t\t\t\tgoto rss_sub_policy_error;\n \t\t\t}\n \t\t\tact_cnt = &mtr_policy->act_cnt[i];\n@@ -16730,19 +16730,21 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev,\n \t\t}\n \t}\n \tif (__flow_dv_create_policy_acts_rules(dev, mtr_policy,\n-\t\tsub_policy, domain)) {\n+\t\t\t\t\t       sub_policy, domain)) {\n \t\tDRV_LOG(ERR, \"Failed to create policy \"\n-\t\t\t\"rules per domain.\");\n+\t\t\t\"rules for ingress domain.\");\n \t\tgoto rss_sub_policy_error;\n \t}\n \tif (sub_policy != mtr_policy->sub_policys[domain][0]) {\n \t\ti = (mtr_policy->sub_policy_num >>\n \t\t\t(MLX5_MTR_SUB_POLICY_NUM_SHIFT * domain)) &\n \t\t\tMLX5_MTR_SUB_POLICY_NUM_MASK;\n+\t\tif (i >= MLX5_MTR_RSS_MAX_SUB_POLICY) {\n+\t\t\tDRV_LOG(ERR, \"No free sub-policy slot.\");\n+\t\t\tgoto rss_sub_policy_error;\n+\t\t}\n \t\tmtr_policy->sub_policys[domain][i] = sub_policy;\n \t\ti++;\n-\t\tif (i > MLX5_MTR_RSS_MAX_SUB_POLICY)\n-\t\t\tgoto rss_sub_policy_error;\n \t\tmtr_policy->sub_policy_num &= ~(MLX5_MTR_SUB_POLICY_NUM_MASK <<\n \t\t\t(MLX5_MTR_SUB_POLICY_NUM_SHIFT * domain));\n \t\tmtr_policy->sub_policy_num |=\n@@ -16760,8 +16762,7 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev,\n \t\t\t(MLX5_MTR_SUB_POLICY_NUM_SHIFT * domain)) &\n \t\t\tMLX5_MTR_SUB_POLICY_NUM_MASK;\n \t\t\tmtr_policy->sub_policys[domain][i] = NULL;\n-\t\t\tmlx5_ipool_free\n-\t\t\t(priv->sh->ipool[MLX5_IPOOL_MTR_POLICY],\n+\t\t\tmlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_MTR_POLICY],\n \t\t\t\t\tsub_policy->idx);\n \t\t}\n \t}\n@@ -16822,7 +16823,7 @@ flow_dv_meter_sub_policy_rss_prepare(struct rte_eth_dev *dev,\n \twhile (i) {\n \t\t/**\n \t\t * From last policy to the first one in hierarchy,\n-\t\t * create/get the sub policy for each of them.\n+\t\t * create / get the sub policy for each of them.\n \t\t */\n \t\tsub_policy = __flow_dv_meter_get_rss_sub_policy(dev,\n \t\t\t\t\t\t\tpolicies[--i],\n@@ -17026,7 +17027,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,\n  */\n static void\n flow_dv_destroy_sub_policy_with_rxq(struct rte_eth_dev *dev,\n-\t\tstruct mlx5_flow_meter_policy *mtr_policy)\n+\t\t\t\t    struct mlx5_flow_meter_policy *mtr_policy)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_flow_meter_sub_policy *sub_policy = NULL;\n@@ -17072,7 +17073,7 @@ flow_dv_destroy_sub_policy_with_rxq(struct rte_eth_dev *dev,\n \t\tcase MLX5_FLOW_FATE_QUEUE:\n \t\t\tsub_policy = mtr_policy->sub_policys[domain][0];\n \t\t\t__flow_dv_destroy_sub_policy_rules(dev,\n-\t\t\t\t\t\tsub_policy);\n+\t\t\t\t\t\t\t   sub_policy);\n \t\t\tbreak;\n \t\tdefault:\n \t\t\t/*Other actions without queue and do nothing*/\n",
    "prefixes": [
        "v2",
        "4/7"
    ]
}