get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1523593,
    "url": "http://patchwork.ozlabs.org/api/patches/1523593/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210902101823.3403153-7-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-7-roid@nvidia.com>",
    "list_archive_url": null,
    "date": "2021-09-02T10:18:23",
    "name": "[ovs-dev,6/6] netdev-offload-tc: Offloading rules with police actions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "985a51e79b95f3629561d3b941a5c2e726495444",
    "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-7-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/1523593/comments/",
    "check": "warning",
    "checks": "http://patchwork.ozlabs.org/api/patches/1523593/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=O8Unw3fS;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "smtp1.osuosl.org (amavisd-new);\n dkim=pass (2048-bit key) header.d=nvidia.com"
        ],
        "Received": [
            "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\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 4H0cN40yN8z9sCD\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Sep 2021 20:19:00 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id D1A9C42549;\n\tThu,  2 Sep 2021 10:18:57 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n\tby localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id iJIQ6wzgwaoO; Thu,  2 Sep 2021 10:18:53 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 979494254A;\n\tThu,  2 Sep 2021 10:18:48 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id A30DAC0026;\n\tThu,  2 Sep 2021 10:18:47 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id CF5E5C0025\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:45 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id BE71B82AC3\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:45 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id LslMUB5mqVdV for <dev@openvswitch.org>;\n Thu,  2 Sep 2021 10:18:44 +0000 (UTC)",
            "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2053.outbound.protection.outlook.com [40.107.244.53])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 61ACB82768\n for <dev@openvswitch.org>; Thu,  2 Sep 2021 10:18:43 +0000 (UTC)",
            "from MW4P222CA0020.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::25)\n by DM5PR1201MB2473.namprd12.prod.outlook.com (2603:10b6:3:e2::14)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.19; Thu, 2 Sep\n 2021 10:18:41 +0000",
            "from CO1NAM11FT049.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:114:cafe::d4) by MW4P222CA0020.outlook.office365.com\n (2603:10b6:303:114::25) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend\n Transport; Thu, 2 Sep 2021 10:18:41 +0000",
            "from mail.nvidia.com (216.228.112.35) by\n CO1NAM11FT049.mail.protection.outlook.com (10.13.175.50) 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:40 +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:39 +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:38 -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=eOLtasR8qoCvtdIsb2zf/4bbqPTGEG7DIkKMMr7f4keBGrbeVxAE4L4V+kI1BixYUrQCQVmXlQJpInaGVv60ODRWfsyab3KQmCZshILBnID2odC6vD97ut+pSWzFq5F7APwsIotMhhYqYEe74gE/Ve9wv3t5Z67XQagf9DhF37Zkfkwos6Sc6OHCljQVGX8jeevCuQBF24N/OYx1JGzhAW/HsNq53AY+47EjogUFJcTUdyXuPRKvUiBA5/SHdR26EA53OZ1HH2Ny9neikw3KKeaAkKfTxXlW4I0hKbjczCt+Wjcm8Rz0v90Z9Z0dAXUd7Z03yQwkbtL3C4xBfWUVTg==",
        "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=7s5IfFEtpNtdp7X1qgcPoP12vtuT2iI6WEDrIRfIBuE=;\n b=TddFwk9PA0Cs84i+gsEzVSl2RgHDuREnBBM+TUe0ZH/Q18BdZyvf1p2oqqQ6yBD69Mq7fhjUnO+9zMVMJP5mZj7T+erGFXQddIjOMxo//sQaGkviBqknZBHMssqMLphsJ8f64BxKuG9vu5vF+z20eSpNut8WzOlOCARzGdZmalgDbKEU8SOumQCW7HbfWzlLMtqQQ11h7xYFyjPtHrsqkAiZ/eKCyWXRyNvGrXtaSWh/ZxLyNd7WxUNEYlINdImcJ0iNyhiqZNWYHSBNMK9nUuSVFZzURxb2Co/lqVQDwk3FkrDhIVIAZv+fVOKP+cFlImfAYnimxeMLKkQijeIAlw==",
        "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=7s5IfFEtpNtdp7X1qgcPoP12vtuT2iI6WEDrIRfIBuE=;\n b=O8Unw3fSRWODhqx4lzT9a7OjVi8QGb9p/dzpY89cBmJgw5+m3Od1C1d2vyRA8TDuQtfZcGerwDxBan9jOvBFH6a+UB9c0sW+DbaorgpyQegtbp3xEQoTtgPXXkLzFaLbUB8K8mgRMsz9TmpAtGQ38ysC9PTa2Yu+ViEe3V5cJ3DdOCmLXhBKXwP/QLlxWeuZG7+8/zadiYGOeVwBuY61e/VdyiDjylFPlfCYuIxW/hs4R8MSp3iYkSePum0x6tN/7LrrFrt5wWcytb3nPQwFvpaeA/cu9QJDkZsZAOTLVKTF5e73qGeWcjWAj0PjAyLOQJqaTD7KeCcC2xIdrG7xjA==",
        "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:23 +0300",
        "Message-ID": "<20210902101823.3403153-7-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": "a514fa2d-cd58-4ecd-d8c3-08d96dfb090d",
        "X-MS-TrafficTypeDiagnostic": "DM5PR1201MB2473:",
        "X-Microsoft-Antispam-PRVS": "\n <DM5PR1201MB247385A77224AE45F3B58F01B8CE9@DM5PR1201MB2473.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:8273;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n 6lQdWv8ZqtoVdjKoN7uncNX6wOMuVjJvVvOEkB//OxMiyOvE1V2BhCDHJjqmFFMaAzXWHfsMaoCqwPhEz1bpkKnL6a0aFruHfKbpm35WpCypBAJhJR/7CwvoVD5j4NWql/nnpOpKkZEIaR5HxX+fjkAdZjlGXcpoA+bHLDcP+xhHPD7mtEgFRPuVZjDAU6xgVcFrC73kHWxr6e5OBvJ1KBaBtxjJVid8HcKtaCh5MZNZwcy/r5eTyTQ6AcNb1bk8PL/ByprELKVA9l6jM/YL2FPuZDS3CuB3PXcd3x3hzzCWCFhjnytFPdLnyKm0LAM0Iz4qPIgZJyczr6X0lzACYoQVFssOODA2ILvzDTsjDvkgCuGJpH4CvYYejmZberTdAlTORwfe+R661aI4MhNeMpBYY8jqsPKHZqtj/RUKDVkWpQ1O0/F0EHZOop/m47wpUrisj2snkzA1f++Nh37+XoxczhJA20NJEpGRVPMzH5bFq+y9+p4Q3nhXQFXgw/Tiy9vMktv9D4eGJMl9P0hkLuF1SAKUSRvDGwDytQSmVCXt+HwVy+NroyC/0JY5D4dld531HtkBPSzQAbLBXnwFnp1QhWQjpVP03Rur2eSpsPJHYluARpg4xkn3x+PUPzzjcf3E8FrkcCaNaGgkXSoyA68qMjFPd/7iuspmbhDkPki+/3bwlAVBIL3Cm9lopb7KX5lwEEBB4fe7WT7i4taqpg==",
        "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:schybrid02.nvidia.com; CAT:NONE;\n SFS:(4636009)(46966006)(36840700001)(4326008)(70206006)(1076003)(83380400001)(82310400003)(107886003)(36906005)(36860700001)(2616005)(2906002)(336012)(508600001)(316002)(36756003)(110136005)(54906003)(426003)(70586007)(8676002)(8936002)(5660300002)(47076005)(6666004)(7636003)(86362001)(356005)(26005)(186003);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 Sep 2021 10:18:40.4048 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n a514fa2d-cd58-4ecd-d8c3-08d96dfb090d",
        "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 CO1NAM11FT049.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM5PR1201MB2473",
        "Cc": "Jianbo Liu <jianbol@nvidia.com>",
        "Subject": "[ovs-dev] [PATCH 6/6] netdev-offload-tc: Offloading rules with\n\tpolice actions",
        "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\nTo offload OVS meter, a meter is mapped to police action. While\noffoading rule, tc should be filled with police index, instead of\nmeter id. So dpif passes police indexes in the additional info to tc\noffload, then they are used to replace meter id in tc rule.\nAn action cookie is created to save meter id on rule creation, so\nmeter id can be retrieved from the cookie, and pass to dpif while\ndumping.\n\nSigned-off-by: Jianbo Liu <jianbol@nvidia.com>\nReviewed-by: Roi Dayan <roid@nvidia.com>\n---\n lib/dpif-netlink.c      | 14 ++++++++++++++\n lib/netdev-offload-tc.c | 11 +++++++++++\n lib/netdev-offload.h    |  4 ++++\n lib/tc.c                | 36 +++++++++++++++++++++++++++++++++++-\n lib/tc.h                |  1 +\n 5 files changed, 65 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c\nindex 409f3f4b6d2b..2ca8ff308c91 100644\n--- a/lib/dpif-netlink.c\n+++ b/lib/dpif-netlink.c\n@@ -2205,6 +2205,7 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put)\n     struct offload_info info;\n     ovs_be16 dst_port = 0;\n     uint8_t csum_on = false;\n+    int n_meters = 0;\n     int err;\n \n     info.tc_modify_flow_deleted = false;\n@@ -2245,6 +2246,19 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put)\n                 csum_on = tnl_cfg->csum;\n             }\n             netdev_close(outdev);\n+        } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_METER) {\n+            uint32_t meter_id = nl_attr_get_u32(nla);\n+            uint32_t police_idx;\n+\n+            if (meter_id_lookup(meter_id, &police_idx)) {\n+                err = EINVAL;\n+                goto out;\n+            }\n+            if (n_meters >= MAX_OFFLOAD_METERS) {\n+                err = EOPNOTSUPP;\n+                goto out;\n+            }\n+            info.police_ids[n_meters++] = police_idx;\n         }\n     }\n \ndiff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c\nindex 9845e8d3feae..757f60fbe8bf 100644\n--- a/lib/netdev-offload-tc.c\n+++ b/lib/netdev-offload-tc.c\n@@ -1015,6 +1015,11 @@ parse_tc_flower_to_match(struct tc_flower *flower,\n                 nl_msg_put_u32(buf, OVS_ACTION_ATTR_RECIRC, action->chain);\n             }\n             break;\n+            case TC_ACT_POLICE: {\n+                nl_msg_put_u32(buf, OVS_ACTION_ATTR_METER,\n+                               action->police.meter_id);\n+            }\n+            break;\n             }\n         }\n     }\n@@ -1580,6 +1585,7 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,\n     uint32_t block_id = 0;\n     struct nlattr *nla;\n     struct tcf_id id;\n+    int n_meters = 0;\n     uint32_t chain;\n     size_t left;\n     int prio = 0;\n@@ -1917,6 +1923,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,\n             action->type = TC_ACT_GOTO;\n             action->chain = 0;  /* 0 is reserved and not used by recirc. */\n             flower.action_count++;\n+        } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_METER) {\n+            action->type = TC_ACT_POLICE;\n+            action->police.meter_id = nl_attr_get_u32(nla);\n+            action->police.index = info->police_ids[n_meters++];\n+            flower.action_count++;\n         } else {\n             VLOG_DBG_RL(&rl, \"unsupported put action type: %d\",\n                         nl_attr_type(nla));\ndiff --git a/lib/netdev-offload.h b/lib/netdev-offload.h\nindex e7fcedae9397..370542e2315c 100644\n--- a/lib/netdev-offload.h\n+++ b/lib/netdev-offload.h\n@@ -27,6 +27,8 @@\n extern \"C\" {\n #endif\n \n+#define MAX_OFFLOAD_METERS 4\n+\n struct dp_packet_batch;\n struct dp_packet;\n struct netdev_class;\n@@ -77,6 +79,8 @@ struct offload_info {\n     bool tc_modify_flow_deleted; /* Indicate the tc modify flow put success\n                                   * to delete the original flow. */\n     odp_port_t orig_in_port; /* Originating in_port for tnl flows. */\n+    uint32_t police_ids[MAX_OFFLOAD_METERS]; /* police ids of the offloaded\n+                                              * meters in the flow */\n };\n \n int netdev_flow_flush(struct netdev *);\ndiff --git a/lib/tc.c b/lib/tc.c\nindex 75c9e1ad16ea..4685fc22f4e2 100644\n--- a/lib/tc.c\n+++ b/lib/tc.c\n@@ -1375,7 +1375,8 @@ static const struct nl_policy police_policy[] = {\n };\n \n static int\n-nl_parse_act_police(const struct nlattr *options, struct tc_flower *flower)\n+nl_parse_act_police(const struct nlattr *options, struct tc_flower *flower,\n+                    struct nlattr *act_cookie)\n {\n     struct nlattr *police_attrs[ARRAY_SIZE(police_policy)] = {};\n     struct tc_action *action;\n@@ -1394,6 +1395,10 @@ nl_parse_act_police(const struct nlattr *options, struct tc_flower *flower)\n     action->type = TC_ACT_POLICE;\n     action->police.index = police->index;\n \n+    if (act_cookie) {\n+        action->police.meter_id = nl_attr_get_u32(act_cookie);\n+    }\n+\n     police_tm = police_attrs[TCA_POLICE_TM];\n     if (police_tm) {\n         tm = nl_attr_get_unspec(police_tm, sizeof *tm);\n@@ -1811,6 +1816,8 @@ nl_parse_single_action(struct nlattr *action, struct tc_flower *flower,\n         /* Added for TC rule only (not in OvS rule) so ignore. */\n     } else if (!strcmp(act_kind, \"ct\")) {\n         nl_parse_act_ct(act_options, flower);\n+    } else if (!strcmp(act_kind, \"police\")) {\n+        nl_parse_act_police(act_options, flower, act_cookie);\n     } else {\n         VLOG_ERR_RL(&error_rl, \"unknown tc action kind: %s\", act_kind);\n         err = EINVAL;\n@@ -2326,6 +2333,22 @@ nl_msg_put_act_gact(struct ofpbuf *request, uint32_t chain)\n }\n \n static void\n+nl_msg_put_act_police_index(struct ofpbuf *request, uint32_t police_idx)\n+{\n+    struct tc_police police;\n+    size_t offset;\n+\n+    memset(&police, 0, sizeof police);\n+    police.index = police_idx;\n+\n+    nl_msg_put_string(request, TCA_ACT_KIND, \"police\");\n+    offset = nl_msg_start_nested(request, TCA_ACT_OPTIONS);\n+    nl_msg_put_unspec(request, TCA_POLICE_TBF, &police, sizeof police);\n+    nl_msg_put_u32(request, TCA_POLICE_RESULT, TC_ACT_PIPE);\n+    nl_msg_end_nested(request, offset);\n+}\n+\n+static void\n nl_msg_put_act_ct(struct ofpbuf *request, struct tc_action *action)\n {\n     uint16_t ct_action = 0;\n@@ -2775,6 +2798,17 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct tc_flower *flower)\n                 nl_msg_end_nested(request, act_offset);\n             }\n             break;\n+            case TC_ACT_POLICE: {\n+                struct tc_cookie act_cookie;\n+\n+                act_offset = nl_msg_start_nested(request, act_index++);\n+                nl_msg_put_act_police_index(request, action->police.index);\n+                act_cookie.data = &action->police.meter_id;\n+                act_cookie.len = sizeof(action->police.meter_id);\n+                nl_msg_put_act_cookie(request, &act_cookie);\n+                nl_msg_end_nested(request, act_offset);\n+            }\n+            break;\n             }\n         }\n     }\ndiff --git a/lib/tc.h b/lib/tc.h\nindex f31bec5d2b4b..32751a8ba6dd 100644\n--- a/lib/tc.h\n+++ b/lib/tc.h\n@@ -261,6 +261,7 @@ struct tc_action {\n         } ct;\n         struct {\n             uint32_t index;\n+            uint32_t meter_id;\n         } police;\n      };\n \n",
    "prefixes": [
        "ovs-dev",
        "6/6"
    ]
}