get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96022,
    "url": "https://patches.dpdk.org/api/patches/96022/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210718171817.23822-7-bingz@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": "<20210718171817.23822-7-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210718171817.23822-7-bingz@nvidia.com",
    "date": "2021-07-18T17:18:16",
    "name": "[v2,6/7] net/mlx5: check consistency of meter policy and profile",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "908f9f92ee88b739c529f72f0a9c6f5102519e6a",
    "submitter": {
        "id": 1976,
        "url": "https://patches.dpdk.org/api/people/1976/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@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/20210718171817.23822-7-bingz@nvidia.com/mbox/",
    "series": [
        {
            "id": 17883,
            "url": "https://patches.dpdk.org/api/series/17883/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17883",
            "date": "2021-07-18T17:18:10",
            "name": "support yellow color policy in mlx5",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/17883/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/96022/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/96022/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 420BFA0C46;\n\tSun, 18 Jul 2021 19:19:35 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2746341194;\n\tSun, 18 Jul 2021 19:19:17 +0200 (CEST)",
            "from NAM10-BN7-obe.outbound.protection.outlook.com\n (mail-bn7nam10on2054.outbound.protection.outlook.com [40.107.92.54])\n by mails.dpdk.org (Postfix) with ESMTP id 504B240683\n for <dev@dpdk.org>; Sun, 18 Jul 2021 19:19:16 +0200 (CEST)",
            "from BN8PR16CA0011.namprd16.prod.outlook.com (2603:10b6:408:4c::24)\n by BL0PR12MB2468.namprd12.prod.outlook.com (2603:10b6:207:44::29)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.29; Sun, 18 Jul\n 2021 17:19:11 +0000",
            "from BN8NAM11FT057.eop-nam11.prod.protection.outlook.com\n (2603:10b6:408:4c:cafe::81) by BN8PR16CA0011.outlook.office365.com\n (2603:10b6:408:4c::24) 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; Sun, 18 Jul 2021 17:19:11 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n BN8NAM11FT057.mail.protection.outlook.com (10.13.177.49) 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:10 +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:07 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=MmxjXZn9f2ZHi5A5j9Osb+EiZe40sAAamNWkWB3dNgx+2DnqUa13PfLhjx7tlbJTmKKfQPbYeaX0e70MTgOvF6r4Fjw20BDf+ONmXMZOr45NtsiSzMXr7BHfQlXlEp6wzfYCYtHoCybrqfMiO53NfF0+l46Pcq2t/f+Zm6TUH2BMaoSlc+x7GprDntavxMMsIGXVFA/0pZX6c9HK9dZyU2SsS8H0L24TOfAmmTX3QK/is05rF7t+PcAyhEZ61tfT8L3wiyMNAtyvozVHsM/Tn07fr2EO7Ki1B4c/Pckg3szBst4mf7VBGI2ofVPhOf1Cpy0kiEkjUxaDvPG7zwhHeg==",
        "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=KG7+3aYN3lcYIA/j23pgo2J1slIapVDfxAfSij4hVac=;\n b=b5FMfN/EOguT38lkZ1yFkjnjrTUOSLEDCSroUdGxMYUhBJyp7QH8lT7PE9hxiO0035hNS44N8EzTTpd9uYY/A8oXm9FTkKjgOdH9s2eXoWSdMNrbgoA39r4uWoyyFRteOXkAWXHDJ7VS2g9tzChV9kI2Nwm/h61xGa9CeP1MIwBtYIdpFlnxRLTl8U/8utKPFFjaC3YXStcEmMsQ5cAgeHctpVvKIO5xhC/sjPgadf+naRMXNwvQfTQsShidWtKglj8MTx/79Ik+0IPCKm5NTznRs+gS0KYiKEXqR/0R3vy1/3g3wbA4VC75tt6GZr7bv5vG22QSieg9vq+3sS//EA==",
        "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=KG7+3aYN3lcYIA/j23pgo2J1slIapVDfxAfSij4hVac=;\n b=HtDBKnkQEKIFuu3HUSqwdNpReCIZWezky+Nh7KIoCo4MONnac7Yh6JvDs8scYc11pHHCEen3KF+KHV1NbVnxrT7ws02Aeb1k/zDcVXLlno6eDePjZQOp9rSZNQ07eAfOGYlT1pdnQs4EQTSANU+pvpwofF2VpVnpusrg1ElyJY08ma5/mhwLhPh9LiATVi/26t6GshmBWNZ4/NviA/C3U2MrmLhvbGobzZIfi5RSujuIu/qae1cxOvBn0a4tmpUepPkDFB8NQnsW+O3OqFUSWYgxO+0W8/8e1aONfPodDD67DjzWQlVg3inPJfhKOwGtT0bkeTTMorQLRoenz/xOvg==",
        "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:16 +0300",
        "Message-ID": "<20210718171817.23822-7-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": "396c854b-8835-4dd8-2e33-08d94a1028a6",
        "X-MS-TrafficTypeDiagnostic": "BL0PR12MB2468:",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BL0PR12MB24684807B2B0A8B165C0F419D0E09@BL0PR12MB2468.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:9508;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n ITyLyFpFlZcRzBjrdYQJYsx/JpsIjAvMe+r8Oz1tb7xHYUrTZmbIyPxq3gu8rWBCbatIVnkwA5DhpAJFZaFGBsm8BbI+uU902M2aQ8BTpDHQFC4+GfkvmdaqeT5BWHOyup/t9XS51gXw3mw4eceFhI6FipchnzMub5cf5RQXTBJxo4SmEEusKkE32URZGucq14IKIpRdR9yiOjqwlCXpkCWft2CTKsL+xhQUjHCWEm/zwhqfsjCScwZPqcKhdXroOKj9cCqnayY3+2QNXYp6ILH+S5l9bnsF3f2YCJqOlk1pAfI/1aC3qPydPzrzvt9qHRBrXmMWqcRB2rqHIE0p6B4TI6KS5vzw9tOEtQWr8+E6qB1aAwX/eDN/Tx5Trrx37o9rf2YhT/lxit6RTKaUQSfStMV+b+zk3AV6Bs25bPi8T5cPh1n2tVbYyESEFpxv0cwzxZ/LcFJlJzlZpsDMR2mH+X7hKPoNePXpxivOVpx6HEmpTVxr16l1ErcqgbZEMXQmWVbDxDU+gqmbbihqmE10sl8EVjK3TCV7qsiuzXXj7/0xhV0F2xPtifV9Fd2wijTYiGHU7atBKQrvFDvsM3S5X6erp/xUB0KxDZquKZ6HEhDqXioVhhLPNGd3hxDUcspgx76fMZ1KERIHDeYOHgX/d3J/ibDibeLL+T3HHHEKr48jN/tYZQSpRj6tkzojpbzeay+ezJ0dVrAPtc9hoOWqVojMMPNOLscsmH9pswQ=",
        "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)(396003)(376002)(346002)(136003)(39860400002)(46966006)(36840700001)(2906002)(34020700004)(5660300002)(36860700001)(6636002)(16526019)(83380400001)(6286002)(8936002)(47076005)(186003)(1076003)(82740400003)(8676002)(107886003)(478600001)(86362001)(336012)(36756003)(26005)(7636003)(426003)(2616005)(7696005)(54906003)(316002)(110136005)(82310400003)(70206006)(70586007)(6666004)(36906005)(356005)(4326008)(55016002);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Jul 2021 17:19:10.9848 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 396c854b-8835-4dd8-2e33-08d94a1028a6",
        "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 BN8NAM11FT057.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BL0PR12MB2468",
        "Subject": "[dpdk-dev] [PATCH v2 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            |  2 ++\n drivers/net/mlx5/mlx5_flow_meter.c | 16 ++++++++++++++--\n 2 files changed, 16 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 9832ed4189..3a8587b7cf 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -870,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_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c\nindex e9b9b22fb2..cf3fb8aa9d 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@@ -1136,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@@ -1153,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": [
        "v2",
        "6/7"
    ]
}