get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96144,
    "url": "http://patchwork.dpdk.org/api/patches/96144/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210721085421.13111-7-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-7-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210721085421.13111-7-bingz@nvidia.com",
    "date": "2021-07-21T08:54:20",
    "name": "[v3,6/7] net/mlx5: check consistency of meter policy and profile",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bf6e87c6139713e14e7c39f5bcd65dedb62065fd",
    "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-7-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/96144/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96144/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 BED05A0C50;\n\tWed, 21 Jul 2021 10:55:27 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B14554113A;\n\tWed, 21 Jul 2021 10:54:57 +0200 (CEST)",
            "from NAM11-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam11on2059.outbound.protection.outlook.com [40.107.223.59])\n by mails.dpdk.org (Postfix) with ESMTP id 95AF741137\n for <dev@dpdk.org>; Wed, 21 Jul 2021 10:54:54 +0200 (CEST)",
            "from MW4PR04CA0063.namprd04.prod.outlook.com (2603:10b6:303:6b::8)\n by MN2PR12MB3008.namprd12.prod.outlook.com (2603:10b6:208:c8::17) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Wed, 21 Jul\n 2021 08:54:53 +0000",
            "from CO1NAM11FT038.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:6b:cafe::1) by MW4PR04CA0063.outlook.office365.com\n (2603:10b6:303:6b::8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22 via Frontend\n Transport; Wed, 21 Jul 2021 08:54:52 +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:52 +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:50 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=T3ByT1ldB6GJzm3akvYNcLV3L0i62WqRmVRDB5memqD9Dh6q60a82RsRF8Xj+qFNuxuj1izOTeNPvzreJCk3f1P8n72kXhdbJUv15elXPuyu3Hw02uAr91Ojkn/+5kXmNIJbvWu7o+0AmG4tOYVw09hRRWnO179daRfF61BOHkTm14ZHVeVBP5Ftdd0Dmf1VteBdC19aCm74r2cHLnZz6gHAwIRKgaT7VoUZ6sB6Z+4WNM1I0EG7x3E+KqjLcuWijSHHAX5kmowDpUbjCT3Fl16ma8EXjxlYDLKkb2TN7w5cbFrrwIR3++5tqQWqrmNDNh78XmFwHAiPfSV2s5orCg==",
        "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=lBBJ1mjxIHgwWyI4nTOodywZIuS6w49I9FEIc8kp3+4=;\n b=NLsjgtEV/RtdoJPnv6T9GqMZJK+OJQAqMEqKRHhgtaGKkG1jtZhxDhAiSVcXUw9lir9dA19aLw1ygPgd34/I2oXtwDkJF0hw5N2h9fgBY9Z2tdmhkrN4pJWNGM5uemv5BBFhxToWO3KJVWUvFeRx8E6M2wTBHktYcGB7C7upUy5VXFoi4OaVewB7t2PFfI4d17XdPkTWRAXOnvtO0HAHcPS3DIGNLfJvI1A8sO0H9s6/h0lILx/Pq7nfaWkKt8eWRNjMEQGDy7t7tg/BCBv88WDlzpHhokwiZYxqMm7drmFzudaMR9pLMxm7ihSjAqxQIDMH9cRxwr4ATKP9y2bgDA==",
        "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=lBBJ1mjxIHgwWyI4nTOodywZIuS6w49I9FEIc8kp3+4=;\n b=KouUsyCcd5S/lfpLqFWbKEov5zvKYCZ9zeuDAkgG/2IAbkQk/4uLwk2hl/p5lvwkYHDKLhzfv7bNRtO3/Du89TGCPY+mxSAAmEFhpHonnDOsxMfDrg5pdzXjZ9K8L1JC7GLpZixjYRoLfEuXu77t0pDsTWayBrW/iMu27PXylmfBhB8RBvJ2CXvOLq4ieyNgio2U3zPA50XhnMdRhl1TamdAMKvLFR0JnAj/yEq47ngMBBnjw7H7R+OleYoDwnsTYe4YcpaTpiiNsrIYYPkSJHQf0UD8W62YpzcyvN3aJICtQ46FgpIRmvKptJ1s/MY0zqL/Vk/6B4LHCjzA1yVHpw==",
        "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:20 +0300",
        "Message-ID": "<20210721085421.13111-7-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": "98f5ba3b-7d7e-4b95-5253-08d94c25348b",
        "X-MS-TrafficTypeDiagnostic": "MN2PR12MB3008:",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <MN2PR12MB30088C9C79809CFD911A40F9D0E39@MN2PR12MB3008.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:8882;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n MnZKyWInSxmV/m8KOy6k5d6luFT4IVaSTqOS6U/M6tzWak1bhXQ6kr5eJWJLmTp41w1IYpt0C8DlbX0uFcT/U2wwDdFsM7wOR7fyKV9R9jKo53jkC5SEI0Wp/DWh4PgOzFRkZr7zVy0QR1Wt2GrFICcdCLEeiqtw/2M4+NQlHLN8jcMeGQZkkKvneIk9VACKuoygVgs6zA8n2sJArDrUj0fydABfy2ZZYfp0yF3EofHyJ3CpCcQKC+SB8ZE4Eq8kcnkLRxEZMOJ9B1J+O/r6tW5Or0Gocc3vx0A1tTFaqGp+ewF/0632+YnsYlnd1lnMRB8/2tRt72hwRHLycBmvkknYzoGfuSTPQjXK6S4/5CIATr+rBdi1yy9wt146SFc/IjNb0HIRVoC62dfEbajigTImSqrftJON7pOiaT6hTPw2iyg16lG85TKfaq9f4RqnAp+AIVR7S+YbobBPMiW4m2e77tuSS8wWWp4QoYyiWzaT/Rs9NivW9l0iEl1HmkjeiE5fvVScDyyZMJ0fq1LOqf2zz3qJPeSx1SPJRzR8g6CjLLWimw0jk41nDhB3UkGOTQZpmPzn6vucXDS5s5yukpbmbNUdWDH7VrYw1enm3B3MUMshK28vl2I+4pTrRV4lHNat09FyK3bMN+OsMgMDvDh7btClaNJKI3OW0bZW4/Cr//+5rX6sjN9RWJEO5ApBG/WZIFLT78T7+EhGpYam5Q==",
        "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)(1076003)(47076005)(6666004)(7636003)(55016002)(70586007)(36756003)(6636002)(8676002)(2616005)(426003)(70206006)(508600001)(110136005)(2906002)(336012)(82310400003)(5660300002)(36906005)(4326008)(83380400001)(16526019)(26005)(86362001)(186003)(107886003)(356005)(36860700001)(8936002)(316002)(7696005)(6286002)(54906003);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "21 Jul 2021 08:54:52.7633 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 98f5ba3b-7d7e-4b95-5253-08d94c25348b",
        "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": "MN2PR12MB3008",
        "Subject": "[dpdk-dev] [PATCH v3 6/7] net/mlx5: check consistency of meter\n policy and profile",
        "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": "In the previous implementation, only green color policy was\nsupported in mlx5 PMD. Since yellow color policy is supported now,\nthe consistency of meter policy and profile should be checked.\n  1. If the profile supports yellow but the policy doesn't, an error\n     should be returned when creating the meter. Or else, there is\n     no explicit steering action for the packets marked with yellow.\n  2. If the policy supports yellow but the profile doesn't, it will\n     be considered as a valid case. Even if no packet will be\n     handled with the yellow steering action, it is just like that\n     only the green policy presents.\n\nUsually the green color is supported by default, but when it is\ndisabled intentionally with setting the CBS to a small value like\nzero in the profile, the similar checking on green policy and\nprofile should also be done.\n\nSigned-off-by: Bing Zhao <bingz@nvidia.com>\n---\n drivers/net/mlx5/mlx5.h            |  6 ++++++\n drivers/net/mlx5/mlx5_flow_dv.c    |  4 ++++\n drivers/net/mlx5/mlx5_flow_meter.c | 20 ++++++++++++++++++--\n 3 files changed, 28 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex ea16109972..3a8587b7cf 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -746,6 +746,10 @@ struct mlx5_flow_meter_policy {\n \t/* Is queue action in policy table. */\n \tuint32_t is_hierarchy:1;\n \t/* Is meter action in policy table. */\n+\tuint32_t skip_y:1;\n+\t/* If yellow color policy is skipped. */\n+\tuint32_t skip_g:1;\n+\t/* If green color policy is skipped. */\n \trte_spinlock_t sl;\n \tuint32_t ref_cnt;\n \t/* Use count. */\n@@ -866,6 +870,8 @@ struct mlx5_flow_meter_profile {\n \t\t/**< srtcm_rfc2697 struct. */\n \t};\n \tuint32_t ref_cnt; /**< Use count. */\n+\tuint32_t g_support:1; /**< If G color will be generated. */\n+\tuint32_t y_support:1; /**< If Y color will be generated. */\n };\n \n /* 2 meters in each ASO cache line */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 97e297d5c2..7ea04ba6e5 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -15245,6 +15245,10 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,\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\t/* Skip the color policy actions creation. */\n+\t\tif ((i == RTE_COLOR_YELLOW && mtr_policy->skip_y) ||\n+\t\t    (i == RTE_COLOR_GREEN && mtr_policy->skip_g))\n+\t\t\tcontinue;\n \t\taction_flags = 0;\n \t\tfor (act = actions[i];\n \t\t     act && act->type != RTE_FLOW_ACTION_TYPE_END; act++) {\ndiff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c\nindex 32ad4ea133..4f57b7e04e 100644\n--- a/drivers/net/mlx5/mlx5_flow_meter.c\n+++ b/drivers/net/mlx5/mlx5_flow_meter.c\n@@ -333,6 +333,10 @@ mlx5_flow_meter_param_fill(struct mlx5_flow_meter_profile *fmp,\n \tebs_exp = exp;\n \tsrtcm->ebs_eir = rte_cpu_to_be_32(ebs_exp << ASO_DSEG_EBS_EXP_OFFSET |\n \t\t\t\t\t  ebs_man << ASO_DSEG_EBS_MAN_OFFSET);\n+\tif (srtcm->cbs_cir)\n+\t\tfmp->g_support = 1;\n+\tif (srtcm->ebs_eir)\n+\t\tfmp->y_support = 1;\n \treturn 0;\n }\n \n@@ -750,6 +754,10 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev,\n \t\treturn -rte_mtr_error_set(error, ENOMEM,\n \t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY, NULL,\n \t\t\t\t\"Memory alloc failed for meter policy.\");\n+\tif (policy_mode == MLX5_MTR_POLICY_MODE_OG)\n+\t\tmtr_policy->skip_y = 1;\n+\telse if (policy_mode == MLX5_MTR_POLICY_MODE_OY)\n+\t\tmtr_policy->skip_g = 1;\n \tpolicy_size = sizeof(struct mlx5_flow_meter_policy);\n \tfor (i = 0; i < MLX5_MTR_DOMAIN_MAX; i++) {\n \t\tif (!(domain_bitmap & (1 << i)))\n@@ -1132,13 +1140,13 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,\n \t\tif (!priv->config.dv_esw_en)\n \t\t\tdomain_bitmap &= ~MLX5_MTR_DOMAIN_TRANSFER_BIT;\n \t} else {\n-\t\tmtr_policy = mlx5_flow_meter_policy_find(dev,\n-\t\t\t\tparams->meter_policy_id, &policy_idx);\n \t\tif (!priv->sh->meter_aso_en)\n \t\t\treturn -rte_mtr_error_set(error, ENOTSUP,\n \t\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\t\"Part of the policies cannot be \"\n \t\t\t\t\"supported without ASO \");\n+\t\tmtr_policy = mlx5_flow_meter_policy_find(dev,\n+\t\t\t\tparams->meter_policy_id, &policy_idx);\n \t\tif (!mtr_policy)\n \t\t\treturn -rte_mtr_error_set(error, ENOENT,\n \t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n@@ -1149,6 +1157,14 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,\n \t\t\t\t\tMLX5_MTR_DOMAIN_EGRESS_BIT : 0) |\n \t\t\t\t(mtr_policy->transfer ?\n \t\t\t\t\tMLX5_MTR_DOMAIN_TRANSFER_BIT : 0);\n+\t\tif (fmp->g_support && mtr_policy->skip_g)\n+\t\t\treturn -rte_mtr_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n+\t\t\t\t\tNULL, \"Meter green policy is empty.\");\n+\t\tif (fmp->y_support && mtr_policy->skip_y)\n+\t\t\treturn -rte_mtr_error_set(error, ENOTSUP,\n+\t\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n+\t\t\t\t\tNULL, \"Meter yellow policy is empty.\");\n \t}\n \t/* Allocate the flow meter memory. */\n \tif (priv->sh->meter_aso_en) {\n",
    "prefixes": [
        "v3",
        "6/7"
    ]
}