get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1523591,
    "url": "http://patchwork.ozlabs.org/api/patches/1523591/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210902101823.3403153-3-roid@nvidia.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20210902101823.3403153-3-roid@nvidia.com>",
    "list_archive_url": null,
    "date": "2021-09-02T10:18:19",
    "name": "[ovs-dev,2/6] tc: Add support parsing tc police action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "205dee9249d02cc66bed2c1d4901a1f7b1cb61fa",
    "submitter": {
        "id": 80349,
        "url": "http://patchwork.ozlabs.org/api/people/80349/",
        "name": "Roi Dayan",
        "email": "roid@nvidia.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210902101823.3403153-3-roid@nvidia.com/mbox/",
    "series": [
        {
            "id": 260708,
            "url": "http://patchwork.ozlabs.org/api/series/260708/",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=260708",
            "date": "2021-09-02T10:18:17",
            "name": "Add support for ovs metering with tc offload",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/260708/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1523591/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1523591/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=A2QSXyd3;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "smtp4.osuosl.org (amavisd-new);\n dkim=pass (2048-bit key) header.d=nvidia.com"
        ],
        "Received": [
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4H0cN20HZ5z9sCD\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Sep 2021 20:18:57 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 67B3380ED1;\n\tThu,  2 Sep 2021 10:18:55 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n\tby localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id irO1o0ewg91O; Thu,  2 Sep 2021 10:18:51 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 3E02082ACA;\n\tThu,  2 Sep 2021 10:18:47 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id EE84CC001B;\n\tThu,  2 Sep 2021 10:18:46 +0000 (UTC)",
            "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id BFCE2C001B\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:45 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 684B8404E0\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:45 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 9kUPwalGPaPf for <dev@openvswitch.org>;\n Thu,  2 Sep 2021 10:18:40 +0000 (UTC)",
            "from NAM10-BN7-obe.outbound.protection.outlook.com\n (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 7B2B340285\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:40 +0000 (UTC)",
            "from MW4PR03CA0258.namprd03.prod.outlook.com (2603:10b6:303:b4::23)\n by CH2PR12MB3766.namprd12.prod.outlook.com (2603:10b6:610:16::21)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.21; Thu, 2 Sep\n 2021 10:18:36 +0000",
            "from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:b4:cafe::2e) by MW4PR03CA0258.outlook.office365.com\n (2603:10b6:303:b4::23) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend\n Transport; Thu, 2 Sep 2021 10:18:36 +0000",
            "from mail.nvidia.com (216.228.112.35) by\n CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4478.19 via Frontend Transport; Thu, 2 Sep 2021 10:18:36 +0000",
            "from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com\n (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Sep\n 2021 10:18:32 +0000",
            "from dev-r-vrt-138.mtr.labs.mlnx (172.20.187.5) by mail.nvidia.com\n (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Thu, 2 Sep 2021 03:18:31 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "whitelisted by SQLgrey-1.8.0",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=U9HSpPxQh9ukuZklg8h/c32chL2DNlbVU249sjMybMYQx7Kd9izmNfxbVIfY6wTj5S1+085VQLa3MFqVw0//Gfb84LBIeoEORsyJiEkjHsltfgrame5fXTT7LVfYn/bANSSLIk5PxpjUK2rAZUjV0cCbcdfxN11Q5Hk9RAMIKxYVdKPawGSiR7iMR9BUIY1BY6ZQV9UbO+sdeFDCHLBWrRr/C6Q5KCkqWPxpof1nGojKHF5JQ1ZHRfAj7lfnTtCbodcnXaa7IFvJp67fkGyQmO5Ra1Tft1lVpVKgYUzD7oMGGRsPUihFfTuqhevo/tfSlieAjoDG+RK6KPPec4KyAA==",
        "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;\n bh=CmDABi5FcorcIfDx0jwt3CEQZ674RvKhKYcUEHXnBlc=;\n b=RkSzpdDUpM8C+H67sNw1UPVeAVof7a+2oo5Luo0hn7pewXFrxHb8TKURRpE3oBGpr1SwB8OQu+UNb5R+43UUekXcGVaKO1VQqOO/maV+KR6+6kbFA8Qu+Yo6RpJ46ErP/mWjSNRabQjHpjx2YWLr9zLBj/1V1FIox6G0pkLR8Stmxrz7BU2x3L7Ywoz+5/JeYKck9zbxFhQwCuUTowhZu8czi4o0Gs4UiUefS9a0Dq001L2N8z5g983sJvO6eUWvBsh+mT/aSTIOdDEqLsUOBmuaN7p09uw+Zg/Byg2rBLgDUshm73YZ6h489R7Hv7s1CMQ+dr5Ok+bhTfqWdcB5UA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.35) smtp.rcpttodomain=ovn.org 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=CmDABi5FcorcIfDx0jwt3CEQZ674RvKhKYcUEHXnBlc=;\n b=A2QSXyd3AfyPVDRk422RPkeWb7fHSXYQYLoBv/K0SK1IQ3s5c8S44zZsZJgwHxJBTsP8R0Wmb4YqBT1QLjCMDq2maRS70zMnI4tZ6Z3o3R32j/+kMMHODg8YVlAi6liEYSK6fMiEGd+Rn/Tn4eYPTxxITyUi5EIadG5GlBrOaEi9284PAKX3kRBAg5ay005OrtPa0ssFURkDHIZ/RaIGxMyZnB5sbKFQmGw5LoPmV99dcQ6UQOTBIFOlPHVM4y2MaL698hXFRR88Nh7+NczGUxy4HohSdfFihW+wOO3rIBv27soxbs7UU+AvMWHgB6Qz2XYJnZYDIudZ400FEsAl9A==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.35)\n smtp.mailfrom=nvidia.com; ovn.org; dkim=none (message not signed)\n header.d=none;ovn.org; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.35 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.35; helo=mail.nvidia.com;",
        "To": "<dev@openvswitch.org>, Ilya Maximets <i.maximets@ovn.org>",
        "Date": "Thu, 2 Sep 2021 13:18:19 +0300",
        "Message-ID": "<20210902101823.3403153-3-roid@nvidia.com>",
        "X-Mailer": "git-send-email 2.26.3",
        "In-Reply-To": "<20210902101823.3403153-1-roid@nvidia.com>",
        "References": "<20210902101823.3403153-1-roid@nvidia.com>",
        "MIME-Version": "1.0",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "f84472d0-60a1-4838-29e4-08d96dfb0692",
        "X-MS-TrafficTypeDiagnostic": "CH2PR12MB3766:",
        "X-Microsoft-Antispam-PRVS": "\n <CH2PR12MB376684883520BD941118F5AAB8CE9@CH2PR12MB3766.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:64;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n YDiIcoSFbeZ19rNjJJbFieT+wNQnQ3QlgESZkaCOUm2M69GSXQPD1BTh6UDbHeXz9TJ1nU8BqIPdVkVtPImt1FMnG003PodnWa73aN6zuXAR5P0B2cVdd++8tsbiyKbYMzoFm6pSAgr2No9+jsNJX/A/XUF2UQfwLu58y/q/JyYebPCZ1nl4Ty4/EwlfHtdv8d84NAG393sfDL0uf7Cg3FO7ZsxsgHP3xMK+NBIJ4WkNFiG0Yrs/RUQpswSf7I2LH6RhbkZ70VQFv6jj/u2aajdcYXojvHTcWxSQqueY/fGN2E17WEku4SdmfUNuCuit4/kX6VHyLgbTUNq0DjmXvkyvA1AG4ru3mupZQqMnvWsA+DmuqM9S39aT6ycd1BV8/66oPRXxyX4lHpKT6wQ9TiqGXNJVHVhNFywnWJZUHyf/6GYc0qJhWwQ8J0Rg8kYMPLP2QhcPsVSHUbBjKw7/v5Nmw6BRbGhB7ALiCFlzY5MZBRIuc3TZpRp6oO9bO2TGWJXilyFeojOxcF8XZVrivZP6Tc2fsYs+OlIa0ND1jP3AhdoInWd7EfDCWlDO9/VlqHBDnLl3HtBggOyiZXeyglls15nZ1zCJ8mTlEyxS8eBP1tBdt1em55jaxQuTWTY2hHBNzYS7GpmoIoPuMe2Flp/PNRgSCbT7lMZswZKgHWGJEIlP6G9sIh0YG/jDENvFhwkU4FwPVEgyosc+E9amXg==",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE;\n SFS:(4636009)(36840700001)(46966006)(86362001)(47076005)(26005)(110136005)(2616005)(36756003)(186003)(426003)(1076003)(336012)(36906005)(6666004)(4326008)(54906003)(70586007)(8676002)(36860700001)(107886003)(356005)(508600001)(2906002)(5660300002)(83380400001)(316002)(82310400003)(7636003)(70206006)(8936002);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 Sep 2021 10:18:36.3017 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n f84472d0-60a1-4838-29e4-08d96dfb0692",
        "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.35];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT013.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CH2PR12MB3766",
        "Cc": "Jianbo Liu <jianbol@nvidia.com>",
        "Subject": "[ovs-dev] [PATCH 2/6] tc: Add support parsing tc police action",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "From": "Roi Dayan via dev <ovs-dev@openvswitch.org>",
        "Reply-To": "Roi Dayan <roid@nvidia.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "From: Jianbo Liu <jianbol@nvidia.com>\n\nAdd function to parse police action from netlink message.\n\nSigned-off-by: Jianbo Liu <jianbol@nvidia.com>\nReviewed-by: Roi Dayan <roid@nvidia.com>\n---\n lib/tc.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n lib/tc.h |  4 ++++\n 2 files changed, 52 insertions(+)",
    "diff": "diff --git a/lib/tc.c b/lib/tc.c\nindex 38a1dfc0ebc8..b351f0e1e65f 100644\n--- a/lib/tc.c\n+++ b/lib/tc.c\n@@ -1341,6 +1341,54 @@ nl_parse_act_gact(struct nlattr *options, struct tc_flower *flower)\n     return 0;\n }\n \n+static const struct nl_policy police_policy[] = {\n+    [TCA_POLICE_TBF] = { .type = NL_A_UNSPEC,\n+                         .min_len = sizeof(struct tc_police),\n+                         .optional = false, },\n+    [TCA_POLICE_RATE] = { .type = NL_A_UNSPEC,\n+                          .min_len = 1024,\n+                          .optional = true, },\n+    [TCA_POLICE_PEAKRATE] = { .type = NL_A_UNSPEC,\n+                              .min_len = 1024,\n+                              .optional = true, },\n+    [TCA_POLICE_AVRATE] = { .type = NL_A_U32,\n+                            .optional = true, },\n+    [TCA_POLICE_RESULT] = { .type = NL_A_U32,\n+                            .optional = true, },\n+    [TCA_POLICE_TM] = { .type = NL_A_UNSPEC,\n+                        .min_len = sizeof(struct tcf_t),\n+                        .optional = true, },\n+};\n+\n+static int\n+nl_parse_act_police(const struct nlattr *options, struct tc_flower *flower)\n+{\n+    struct nlattr *police_attrs[ARRAY_SIZE(police_policy)] = {};\n+    struct tc_action *action;\n+    const struct tc_police *police;\n+    struct nlattr *police_tm;\n+    const struct tcf_t *tm;\n+\n+    if (!nl_parse_nested(options, police_policy, police_attrs,\n+                         ARRAY_SIZE(police_policy))) {\n+        VLOG_ERR_RL(&error_rl, \"failed to parse police action options\");\n+        return EPROTO;\n+    }\n+\n+    police = nl_attr_get(police_attrs[TCA_POLICE_TBF]);\n+    action = &flower->actions[flower->action_count++];\n+    action->type = TC_ACT_POLICE;\n+    action->police.index = police->index;\n+\n+    police_tm = police_attrs[TCA_POLICE_TM];\n+    if (police_tm) {\n+        tm = nl_attr_get_unspec(police_tm, sizeof *tm);\n+        nl_parse_tcf(tm, flower);\n+    }\n+\n+    return 0;\n+}\n+\n static const struct nl_policy mirred_policy[] = {\n     [TCA_MIRRED_PARMS] = { .type = NL_A_UNSPEC,\n                            .min_len = sizeof(struct tc_mirred),\ndiff --git a/lib/tc.h b/lib/tc.h\nindex a147ca461dc5..85ae5a8908ea 100644\n--- a/lib/tc.h\n+++ b/lib/tc.h\n@@ -174,6 +174,7 @@ enum tc_action_type {\n     TC_ACT_MPLS_SET,\n     TC_ACT_GOTO,\n     TC_ACT_CT,\n+    TC_ACT_POLICE,\n };\n \n enum nat_type {\n@@ -256,6 +257,9 @@ struct tc_action {\n             bool force;\n             bool commit;\n         } ct;\n+        struct {\n+            uint32_t index;\n+        } police;\n      };\n \n      enum tc_action_type type;\n",
    "prefixes": [
        "ovs-dev",
        "2/6"
    ]
}