get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525730,
    "url": "http://patchwork.ozlabs.org/api/patches/1525730/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/ede8f89b01ad4711f4b13b1663606b740cf2134e.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": "<ede8f89b01ad4711f4b13b1663606b740cf2134e.1631094144.git.grive@u256.net>",
    "list_archive_url": null,
    "date": "2021-09-08T09:47:44",
    "name": "[ovs-dev,v5,20/27] netdev-offload-dpdk: Use per-thread HW offload stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3675a1020ec73e8671c7efac8b573e05eadb3727",
    "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/ede8f89b01ad4711f4b13b1663606b740cf2134e.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/1525730/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525730/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=vzj0fX7t;\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=s6dSXvjL;\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>)"
        ],
        "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 4H4HRx2DSxz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 19:50:05 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id CDDDB42621;\n\tWed,  8 Sep 2021 09:50:02 +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 MUGn5dDyCUvj; Wed,  8 Sep 2021 09:50:02 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 1313A42612;\n\tWed,  8 Sep 2021 09:50:01 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id DBD5AC0011;\n\tWed,  8 Sep 2021 09:50:00 +0000 (UTC)",
            "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 32392C000D\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:49:59 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 80CBA40779\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:34 +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 mpsy_vfFLr-a for <ovs-dev@openvswitch.org>;\n Wed,  8 Sep 2021 09:48:34 +0000 (UTC)",
            "from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com\n [64.147.123.19])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 024AD4070D\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:33 +0000 (UTC)",
            "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n by mailout.west.internal (Postfix) with ESMTP id 6F1B732009E4;\n Wed,  8 Sep 2021 05:48:33 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute2.internal (MEProxy); Wed, 08 Sep 2021 05:48:33 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 8 Sep 2021 05:48:32 -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=Dot+oNYgIDKJf\n rwpAJ5M+eagwCBDQLBJMHQjnE+fvYY=; b=vzj0fX7tvVFOeGCbMv0Ltu/K3HApK\n WdGpeh7WwZeM2XY8ndRetHqYTRWzvGv5UNCF98cDwITGMms5pKgrbF1TcYdD65kW\n ALdEuTzc/3gZKMcvzy02QPTAS8yrxwSffizH5SqUfqCcT3SXrNG1Ytn1cMGGHOiW\n QkgDav6Ya+P0xH+GjcveHnVA5qRJ6h2cmq4SajvtR7srPz8N6DLr122BCTH8h1gD\n LXwmCQEeczIxBIFgs+Y9h6OECFRtaHZIwA+HeILOkc458heHW/FA98B0P8ZKRinC\n GCnbOdJxJShmuymzYIXcZQYPM/JyRMNGAlc/UATkBOPuL/q+941gg4EwQ==",
            "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=Dot+oNYgIDKJfrwpAJ5M+eagwCBDQLBJMHQjnE+fvYY=; b=s6dSXvjL\n PPkjyORS91kCTYrlsEelBjC3P0WI1RP0tjtT53VhhHN8nKKmwTMZVNwvQmyESscV\n 56FAAdnYIocPDv38vJBimyb31JnMtoGWOUPzPthIUYpteK5kTAMaKV/g8QLpzf9P\n vv9OCCQI+hVutFegXaH+aI9khL+4Co6poGwAhbhkiwh0Ka+TyKAAWrBayaiZf60Y\n r4EKbNSpAzpWiNtgBnUaP5DKntcyJCuVwRW1yaze14mYmm2mW3fVr9B5XkYtzQ+p\n qX8gDj9dn51lxVmICJtLXiyO6D6jviJSrUw7wZxEjzewvjUtcyugbIhf9zfoDAf2\n Y3AyO1URtnGZHQ=="
        ],
        "X-ME-Sender": "<xms:8YY4YeEN0Mdr9w2ubkgbVW8xB64QRld4IOM6JuiC9HkxOwV5lCkfGg>\n <xme:8YY4YfUqcDHxBUOgN6LUeO-MPa7MCjGBmOV7q8LKNW7hz2hda5ERbXfHDhwSoSXp3\n XeGHjmxerT91JR5bjQ>",
        "X-ME-Received": "\n <xmr:8YY4YYLAltqMIMyHWf5Qi6AgP4SI-e2ZpoXwQN9bTg75Lf5k-y1oSU5WV_bYIelEOJ73wykU0V2Ap-pkAu5r5flH2g>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudekucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvthgr\n nhcutfhivhgvthcuoehgrhhivhgvsehuvdehiedrnhgvtheqnecuggftrfgrthhtvghrnh\n ephefgveffkeetheetfeeifedvheelfeejfeehveduteejhfekuedtkeeiuedvteehnecu\n vehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepghhrihhvvg\n esuhdvheeirdhnvght",
        "X-ME-Proxy": "<xmx:8YY4YYEv4PuZhzzplwxpkhLsvG-YM03tM1ZSqw2oGF6925Wx6KMljg>\n <xmx:8YY4YUXkUY4H5UHUARr_TkTs1n8PlSqHmjLNdzZwL1rGF6-iVpGJVA>\n <xmx:8YY4YbPLdvKvvVr1YrOl8LvIRrInt6Uwr8FYFINIsKtpgdGsAKYixA>\n <xmx:8YY4YfdJY83f8gtKqAW1JxgTmg5PeAgSvY_DGHPWptmbu6e_VD9yuw>",
        "From": "Gaetan Rivet <grive@u256.net>",
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed,  8 Sep 2021 11:47:44 +0200",
        "Message-Id": "\n <ede8f89b01ad4711f4b13b1663606b740cf2134e.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 20/27] netdev-offload-dpdk: Use per-thread HW\n\toffload stats",
        "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": "The implementation of hardware offload counters in currently meant to be\nmanaged by a single thread. Use the offload thread pool API to manage\none counter per thread.\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 | 16 ++++++++++++----\n 1 file changed, 12 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c\nindex 931518ab0..8ed869eb3 100644\n--- a/lib/netdev-offload-dpdk.c\n+++ b/lib/netdev-offload-dpdk.c\n@@ -68,7 +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+    uint64_t *rte_flow_counters;\n };\n \n static int\n@@ -78,6 +78,8 @@ offload_data_init(struct netdev *netdev)\n \n     data = xzalloc(sizeof *data);\n     cmap_init(&data->ufid_to_rte_flow);\n+    data->rte_flow_counters = xcalloc(netdev_offload_thread_nb(),\n+                                      sizeof *data->rte_flow_counters);\n \n     ovsrcu_set(&netdev->hw_info.offload_data, (void *) data);\n \n@@ -87,6 +89,7 @@ offload_data_init(struct netdev *netdev)\n static void\n offload_data_destroy__(struct netdev_offload_dpdk_data *data)\n {\n+    free(data->rte_flow_counters);\n     free(data);\n }\n \n@@ -732,10 +735,11 @@ netdev_offload_dpdk_flow_create(struct netdev *netdev,\n     flow = netdev_dpdk_rte_flow_create(netdev, attr, items, actions, error);\n     if (flow) {\n         struct netdev_offload_dpdk_data *data;\n+        unsigned int tid = netdev_offload_thread_id();\n \n         data = (struct netdev_offload_dpdk_data *)\n             ovsrcu_get(void *, &netdev->hw_info.offload_data);\n-        data->rte_flow_counter++;\n+        data->rte_flow_counters[tid]++;\n \n         if (!VLOG_DROP_DBG(&rl)) {\n             dump_flow(&s, &s_extra, attr, flow_patterns, flow_actions);\n@@ -1985,10 +1989,11 @@ netdev_offload_dpdk_flow_destroy(struct ufid_to_rte_flow_data *rte_flow_data)\n \n     if (ret == 0) {\n         struct netdev_offload_dpdk_data *data;\n+        unsigned int tid = netdev_offload_thread_id();\n \n         data = (struct netdev_offload_dpdk_data *)\n             ovsrcu_get(void *, &netdev->hw_info.offload_data);\n-        data->rte_flow_counter--;\n+        data->rte_flow_counters[tid]--;\n \n         ufid_to_rte_flow_disassociate(rte_flow_data);\n         VLOG_DBG_RL(&rl, \"%s/%s: rte_flow 0x%\"PRIxPTR\n@@ -2343,6 +2348,7 @@ netdev_offload_dpdk_get_n_flows(struct netdev *netdev,\n                                 uint64_t *n_flows)\n {\n     struct netdev_offload_dpdk_data *data;\n+    unsigned int tid;\n \n     data = (struct netdev_offload_dpdk_data *)\n         ovsrcu_get(void *, &netdev->hw_info.offload_data);\n@@ -2350,7 +2356,9 @@ netdev_offload_dpdk_get_n_flows(struct netdev *netdev,\n         return -1;\n     }\n \n-    *n_flows = data->rte_flow_counter;\n+    for (tid = 0; tid < netdev_offload_thread_nb(); tid++) {\n+        n_flows[tid] = data->rte_flow_counters[tid];\n+    }\n \n     return 0;\n }\n",
    "prefixes": [
        "ovs-dev",
        "v5",
        "20/27"
    ]
}