get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525715,
    "url": "http://patchwork.ozlabs.org/api/patches/1525715/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/91328edbf46fa283f55e12991d8e3f5891720ced.1631094144.git.grive@u256.net/",
    "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": "<91328edbf46fa283f55e12991d8e3f5891720ced.1631094144.git.grive@u256.net>",
    "list_archive_url": null,
    "date": "2021-09-08T09:47:30",
    "name": "[ovs-dev,v5,06/27] netdev-offload-dpdk: Implement hw-offload statistics read",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b2e0acc54e9f073a50fedce977a68e2e0f9bd665",
    "submitter": {
        "id": 78795,
        "url": "http://patchwork.ozlabs.org/api/people/78795/",
        "name": "Gaëtan Rivet",
        "email": "grive@u256.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/91328edbf46fa283f55e12991d8e3f5891720ced.1631094144.git.grive@u256.net/mbox/",
    "series": [
        {
            "id": 261424,
            "url": "http://patchwork.ozlabs.org/api/series/261424/",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=261424",
            "date": "2021-09-08T09:47:24",
            "name": "dpif-netdev: Parallel offload processing",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/261424/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1525715/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525715/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ovs-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=u256.net header.i=@u256.net header.a=rsa-sha256\n header.s=fm2 header.b=afJKTLVS;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=messagingengine.com header.i=@messagingengine.com\n header.a=rsa-sha256 header.s=fm3 header.b=fK9Y3qQO;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)"
        ],
        "Received": [
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.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 4H4HQ20TQfz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 19:48:26 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id E20F5835C4;\n\tWed,  8 Sep 2021 09:48:23 +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 aWnxNeYrLn1R; Wed,  8 Sep 2021 09:48:21 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 11057833A0;\n\tWed,  8 Sep 2021 09:48:19 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id E0D29C0011;\n\tWed,  8 Sep 2021 09:48:18 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 14398C001C\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:17 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id A4EAB8332A\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:13 +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 LawkmZaIxsSv for <ovs-dev@openvswitch.org>;\n Wed,  8 Sep 2021 09:48:12 +0000 (UTC)",
            "from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com\n [64.147.123.19])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 96A94830FB\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:11 +0000 (UTC)",
            "from compute5.internal (compute5.nyi.internal [10.202.2.45])\n by mailout.west.internal (Postfix) with ESMTP id ECA1032009C7;\n Wed,  8 Sep 2021 05:48:10 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute5.internal (MEProxy); Wed, 08 Sep 2021 05:48:11 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 8 Sep 2021 05:48:09 -0400 (EDT)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.8.0",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=u256.net; h=from\n :to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm2; bh=TR0g3tXf4X2s3\n BaVFzhZsgkeQRR/0wV9nmykyN59ov8=; b=afJKTLVS+nf9/K/CGPjOuR1R9q5oC\n 9rSKMNIMtPMK895vZmdy6Nca8DANYicEpDeY++oDemeim3z26s/fSq0jp23GpLCr\n YAtjyFj3IhNGuHbCyTPWg3FAiv102U4MLJ3NiNdIXeLbCmqd6+oBIJ6zyF69hFXV\n dfqaHpLM2cnLbigGmoZ/vyibejaYgSWrhwZdhsp3HT3RHkDbr8/qgFWoYapfkL1C\n Nr+a0FvFmXei3oTdv4XzDfF2DR11ls3lIMCmMI/xXBOTxGqlicJgjzl5+lSlBYoV\n PMl0MKr8QImXW5/AifTWRUBgBXwZtowoM6DzxrgIxB1qJegq2WK7Mg3PQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm3; bh=TR0g3tXf4X2s3BaVFzhZsgkeQRR/0wV9nmykyN59ov8=; b=fK9Y3qQO\n FRm5hxA5VUrViozc/r/YRgiyfgnkXCF3JOQf6ZfF7ZYKyuicx1wBJSw5GWoF+9Xb\n +7IPAYpXxT01tZyJ+XW9cyUTMGyT9i1mLJIFsx7JC2OrAoxT4uGuGXB+hJcB6q1H\n v2Abz0a5dod8GxghdLrD7c53q1+7IjIZvS/Vgfk0Ei5W1JJcL2k+11kAJkxhCY5v\n VJgnxTO9s0GZor82sk3IiSKl4ceh6m929yRkCmW0svwU5ZKFr8MkLk/J2M38ZqBo\n wSthYxv9+JcqX9BCwh4ieWIoEjub2/4uzKaOsApz71kP75ZkLzhNz3g+T1mwIVFt\n my2ELsefbXIRxQ=="
        ],
        "X-ME-Sender": "<xms:2oY4YQ84m0b28iX2pdtNasJNe46BTrW-fba0R9xZqKYqFhlcuDTDhQ>\n <xme:2oY4YYt0Pnzp7uANZOANQJzY07HlPc8b9lCwutFWfLFkn3mAl5Kb3d2DfJSp_w1A3\n 9LiZ0ociyAuQ8d1XUI>",
        "X-ME-Received": "\n <xmr:2oY4YWDZ0PRLzHcUtUYelEgZpCOPKorzDU-4GH7bg1RVswRe7PWV9zU5Uzi2T9TQgN_LaSbYUNFSV5CjEJx8jIBEMQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudekucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvthgr\n nhcutfhivhgvthcuoehgrhhivhgvsehuvdehiedrnhgvtheqnecuggftrfgrthhtvghrnh\n ephefgveffkeetheetfeeifedvheelfeejfeehveduteejhfekuedtkeeiuedvteehnecu\n vehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepghhrihhvvg\n esuhdvheeirdhnvght",
        "X-ME-Proxy": "<xmx:2oY4YQc6nMkFQqbWxo2msi2OgrreOaJPq3oQZvjrv1P_1QJ2dZjEWw>\n <xmx:2oY4YVPDXgAaeAv9n1hrbjg47jwmQCtta9tbgy1Nyt3LlTmD0wbr8Q>\n <xmx:2oY4YalYQNcaPuMVznzH0FIHYcKjILdV7JbdtnLLx-XkArJmG5xOnQ>\n <xmx:2oY4YT3fh9yS0uWU2p3krUW3S5rOIuXeP50c7ubW7uSdOOAySqv9mA>",
        "From": "Gaetan Rivet <grive@u256.net>",
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed,  8 Sep 2021 11:47:30 +0200",
        "Message-Id": "\n <91328edbf46fa283f55e12991d8e3f5891720ced.1631094144.git.grive@u256.net>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<cover.1631094144.git.grive@u256.net>",
        "References": "<cover.1631094144.git.grive@u256.net>",
        "MIME-Version": "1.0",
        "Cc": "Eli Britstein <elibr@nvidia.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[ovs-dev] [PATCH v5 06/27] netdev-offload-dpdk: Implement\n\thw-offload statistics read",
        "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>",
        "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": "In the DPDK offload provider, keep track of inserted rte_flow and report\nit when queried.\n\nSigned-off-by: Gaetan Rivet <grive@u256.net>\nReviewed-by: Eli Britstein <elibr@nvidia.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/netdev-offload-dpdk.c | 31 +++++++++++++++++++++++++++++++\n 1 file changed, 31 insertions(+)",
    "diff": "diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c\nindex 2d1e31ece..931518ab0 100644\n--- a/lib/netdev-offload-dpdk.c\n+++ b/lib/netdev-offload-dpdk.c\n@@ -68,6 +68,7 @@ struct ufid_to_rte_flow_data {\n \n struct netdev_offload_dpdk_data {\n     struct cmap ufid_to_rte_flow;\n+    uint64_t rte_flow_counter;\n };\n \n static int\n@@ -730,6 +731,12 @@ netdev_offload_dpdk_flow_create(struct netdev *netdev,\n \n     flow = netdev_dpdk_rte_flow_create(netdev, attr, items, actions, error);\n     if (flow) {\n+        struct netdev_offload_dpdk_data *data;\n+\n+        data = (struct netdev_offload_dpdk_data *)\n+            ovsrcu_get(void *, &netdev->hw_info.offload_data);\n+        data->rte_flow_counter++;\n+\n         if (!VLOG_DROP_DBG(&rl)) {\n             dump_flow(&s, &s_extra, attr, flow_patterns, flow_actions);\n             extra_str = ds_cstr(&s_extra);\n@@ -1977,6 +1984,12 @@ netdev_offload_dpdk_flow_destroy(struct ufid_to_rte_flow_data *rte_flow_data)\n     ret = netdev_dpdk_rte_flow_destroy(physdev, rte_flow, &error);\n \n     if (ret == 0) {\n+        struct netdev_offload_dpdk_data *data;\n+\n+        data = (struct netdev_offload_dpdk_data *)\n+            ovsrcu_get(void *, &netdev->hw_info.offload_data);\n+        data->rte_flow_counter--;\n+\n         ufid_to_rte_flow_disassociate(rte_flow_data);\n         VLOG_DBG_RL(&rl, \"%s/%s: rte_flow 0x%\"PRIxPTR\n                     \" flow destroy %d ufid \" UUID_FMT,\n@@ -2325,6 +2338,23 @@ close_vport_netdev:\n     return ret;\n }\n \n+static int\n+netdev_offload_dpdk_get_n_flows(struct netdev *netdev,\n+                                uint64_t *n_flows)\n+{\n+    struct netdev_offload_dpdk_data *data;\n+\n+    data = (struct netdev_offload_dpdk_data *)\n+        ovsrcu_get(void *, &netdev->hw_info.offload_data);\n+    if (!data) {\n+        return -1;\n+    }\n+\n+    *n_flows = data->rte_flow_counter;\n+\n+    return 0;\n+}\n+\n const struct netdev_flow_api netdev_offload_dpdk = {\n     .type = \"dpdk_flow_api\",\n     .flow_put = netdev_offload_dpdk_flow_put,\n@@ -2334,4 +2364,5 @@ const struct netdev_flow_api netdev_offload_dpdk = {\n     .flow_get = netdev_offload_dpdk_flow_get,\n     .flow_flush = netdev_offload_dpdk_flow_flush,\n     .hw_miss_packet_recover = netdev_offload_dpdk_hw_miss_packet_recover,\n+    .flow_get_n_flows = netdev_offload_dpdk_get_n_flows,\n };\n",
    "prefixes": [
        "ovs-dev",
        "v5",
        "06/27"
    ]
}