get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1525717,
    "url": "http://patchwork.ozlabs.org/api/patches/1525717/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/83639605b592cfc094702acbe1aba4519e974902.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": "<83639605b592cfc094702acbe1aba4519e974902.1631094144.git.grive@u256.net>",
    "list_archive_url": null,
    "date": "2021-09-08T09:47:31",
    "name": "[ovs-dev,v5,07/27] dpctl: Add function to read hardware offload statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "dc99db0ab335b88d518db7f51a282d87bb40ef88",
    "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/83639605b592cfc094702acbe1aba4519e974902.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/1525717/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525717/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=kcDpvrMf;\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=TcFWpsXu;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::133; helo=smtp2.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=u256.net header.b=\"kcDpvrMf\";\n dkim=pass (2048-bit key) header.d=messagingengine.com\n header.b=\"TcFWpsXu\""
        ],
        "Received": [
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\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 4H4HQJ0zSYz9t54\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Sep 2021 19:48:40 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id BAECE4072D;\n\tWed,  8 Sep 2021 09:48:37 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n\tby localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id vcOvGWLBv9FY; Wed,  8 Sep 2021 09:48:36 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id A9B8C404C8;\n\tWed,  8 Sep 2021 09:48:35 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 7DB55C0011;\n\tWed,  8 Sep 2021 09:48:35 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 23421C001C\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id EC66D8329E\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:18 +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 y-GRipY1586B for <ovs-dev@openvswitch.org>;\n Wed,  8 Sep 2021 09:48:14 +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 1BB1B832DC\n for <ovs-dev@openvswitch.org>; Wed,  8 Sep 2021 09:48:13 +0000 (UTC)",
            "from compute4.internal (compute4.nyi.internal [10.202.2.44])\n by mailout.west.internal (Postfix) with ESMTP id 7995932009B3;\n Wed,  8 Sep 2021 05:48:12 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute4.internal (MEProxy); Wed, 08 Sep 2021 05:48:12 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Wed,\n 8 Sep 2021 05:48:11 -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=S9yrF+s5BitaC\n rkLkTdJBSViCqrI1s2PjHBc/qkHWWc=; b=kcDpvrMfJVRDjUFUMvw56wkeu96so\n J1hNwZySgxH2NhGE2OWtHwlbJGuy1gnwW7ReK1/UTFpCMG2WQ4T7I/DTL0wrWrGZ\n phSfaiUx5OmH+KMukFJrGm/ijxCKtmp9oxUnqqnuuIFPjxGGNQ9yobDfGGrAmiUQ\n yv5oR1/pGb2VlHuPs/F615J2biLLv6KOH0g5ssfRj+BxX/rLJIBTpNb3zAf8x3V1\n MnMpSbvCLoaogRP94cfsKvpgXfhiSPcrgtupt+Ns+6N7uGbNFTWUbGnAHv4XhWzt\n MQBStEwBmEuRK08T6b6Wimj4dZCuYWwn6OduT2Vq/9OoLC2lKtMC7n6/A==",
            "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=S9yrF+s5BitaCrkLkTdJBSViCqrI1s2PjHBc/qkHWWc=; b=TcFWpsXu\n Bqe12YHb3Gr6hiLkNKPMMhWDkdLY/t+d51PAyqO0ZkMnLpMEWeTZWDH08Loe73eQ\n OKJ9IE1xmLejQA/apnF7uLZArotfXaajuUrqh+n0PEaycoLFiCXXrVPpVADowFoB\n dFDjKyArkwiOtZwtSYQRXgWFqhzldBhSBqezTgeoFstbrqQltKUvB6HxOMNU68hY\n 8UyHHeRu6C8UMvYfmePNFVi3J0Vz6+uf5MoH5RTes4kKEsJc0RKuvg6+WzVOIj5e\n oCJ+DuMo14Ts7HJ00gzYVQL1smlyOS2MTGxh2k4jS9x+1ju3FYAKHJg4xgsFbUUe\n VvjBzK92NVMN9Q=="
        ],
        "X-ME-Sender": "<xms:3IY4Yb22zLloFKFtaRPoPxpZzrjy__4s-y6qGZQWo4ONBaPmIKIVDg>\n <xme:3IY4YaG4iay3iyjTyeRcysTgYjsRsAFljikFI0IFZVqBmY1Q03i_zcjXXj7Hm-qeM\n mjNPyw4ccKvtgxm0zE>",
        "X-ME-Received": "\n <xmr:3IY4Yb6aUPyixBJHmvIIvbk4fixLvwHd7fTlXDZ5au9tIUncuIBjLoocyeLJBMZUSC9IVveHx6-usKDrC-KhsJ2XhQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudekucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvthgr\n nhcutfhivhgvthcuoehgrhhivhgvsehuvdehiedrnhgvtheqnecuggftrfgrthhtvghrnh\n ephefgveffkeetheetfeeifedvheelfeejfeehveduteejhfekuedtkeeiuedvteehnecu\n vehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepghhrihhvvg\n esuhdvheeirdhnvght",
        "X-ME-Proxy": "<xmx:3IY4YQ0DZInOcSJ4if0k6W_mvcjB4-iTFuSlyjp9UG-SomyTn01FfQ>\n <xmx:3IY4YeG-kqwhhaLQHSu-U8wHmhv4Yb73vln2TWhSETS6KTyjVt_eYw>\n <xmx:3IY4YR8ITOhMgtd-4TPZoSZTSog-Aauipm6FnCELSSGaQXgd9C7hag>\n <xmx:3IY4YQODAXMxvGiFmm7gjtfKzawpJ0gp_cFJNho4_UdpZZiQ2778GA>",
        "From": "Gaetan Rivet <grive@u256.net>",
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed,  8 Sep 2021 11:47:31 +0200",
        "Message-Id": "\n <83639605b592cfc094702acbe1aba4519e974902.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 07/27] dpctl: Add function to read hardware\n\toffload statistics",
        "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": "Expose a function to query datapath offload statistics.\nThis function is separate from the current one in netdev-offload\nas it exposes more detailed statistics from the datapath, instead of\nonly from the netdev-offload provider.\n\nEach datapath is meant to use the custom counters as it sees fit for its\nhandling of hardware offloads.\n\nCall the new API from dpctl.\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/dpctl.c         | 36 ++++++++++++++++++++++++++++++++++++\n lib/dpif-netdev.c   |  1 +\n lib/dpif-netlink.c  |  1 +\n lib/dpif-provider.h |  7 +++++++\n lib/dpif.c          |  8 ++++++++\n lib/dpif.h          |  9 +++++++++\n 6 files changed, 62 insertions(+)",
    "diff": "diff --git a/lib/dpctl.c b/lib/dpctl.c\nindex ef8ae7402..6ff73e2d9 100644\n--- a/lib/dpctl.c\n+++ b/lib/dpctl.c\n@@ -1541,6 +1541,40 @@ dpctl_del_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)\n     return error;\n }\n \n+static int\n+dpctl_offload_stats_show(int argc, const char *argv[],\n+                         struct dpctl_params *dpctl_p)\n+{\n+    struct netdev_custom_stats stats;\n+    struct dpif *dpif;\n+    int error;\n+    size_t i;\n+\n+    error = opt_dpif_open(argc, argv, dpctl_p, 2, &dpif);\n+    if (error) {\n+        return error;\n+    }\n+\n+    memset(&stats, 0, sizeof(stats));\n+    error = dpif_offload_stats_get(dpif, &stats);\n+    if (error) {\n+        dpctl_error(dpctl_p, error, \"retrieving offload statistics\");\n+        goto close_dpif;\n+    }\n+\n+    dpctl_print(dpctl_p, \"HW Offload stats:\\n\");\n+    for (i = 0; i < stats.size; i++) {\n+        dpctl_print(dpctl_p, \"   %s: %6\" PRIu64 \"\\n\",\n+                    stats.counters[i].name, stats.counters[i].value);\n+    }\n+\n+    netdev_free_custom_stats_counters(&stats);\n+\n+close_dpif:\n+    dpif_close(dpif);\n+    return error;\n+}\n+\n static int\n dpctl_help(int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,\n            struct dpctl_params *dpctl_p)\n@@ -2697,6 +2731,8 @@ static const struct dpctl_command all_commands[] = {\n     { \"add-flows\", \"[dp] file\", 1, 2, dpctl_process_flows, DP_RW },\n     { \"mod-flows\", \"[dp] file\", 1, 2, dpctl_process_flows, DP_RW },\n     { \"del-flows\", \"[dp] [file]\", 0, 2, dpctl_del_flows, DP_RW },\n+    { \"offload-stats-show\", \"[dp]\",\n+      0, 1, dpctl_offload_stats_show, DP_RO },\n     { \"dump-conntrack\", \"[-m] [-s] [dp] [zone=N]\",\n       0, 4, dpctl_dump_conntrack, DP_RO },\n     { \"flush-conntrack\", \"[dp] [zone=N] [ct-tuple]\", 0, 3,\ndiff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c\nindex 42c078657..a36ff9456 100644\n--- a/lib/dpif-netdev.c\n+++ b/lib/dpif-netdev.c\n@@ -8741,6 +8741,7 @@ const struct dpif_class dpif_netdev_class = {\n     dpif_netdev_flow_dump_thread_destroy,\n     dpif_netdev_flow_dump_next,\n     dpif_netdev_operate,\n+    NULL,                       /* offload_stats_get */\n     NULL,                       /* recv_set */\n     NULL,                       /* handlers_set */\n     NULL,                       /* number_handlers_required */\ndiff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c\nindex 34fc04237..b403b062f 100644\n--- a/lib/dpif-netlink.c\n+++ b/lib/dpif-netlink.c\n@@ -4293,6 +4293,7 @@ const struct dpif_class dpif_netlink_class = {\n     dpif_netlink_flow_dump_thread_destroy,\n     dpif_netlink_flow_dump_next,\n     dpif_netlink_operate,\n+    NULL,                       /* offload_stats_get */\n     dpif_netlink_recv_set,\n     dpif_netlink_handlers_set,\n     dpif_netlink_number_handlers_required,\ndiff --git a/lib/dpif-provider.h b/lib/dpif-provider.h\nindex 7e11b9697..8bdda37f0 100644\n--- a/lib/dpif-provider.h\n+++ b/lib/dpif-provider.h\n@@ -331,6 +331,13 @@ struct dpif_class {\n     void (*operate)(struct dpif *dpif, struct dpif_op **ops, size_t n_ops,\n                     enum dpif_offload_type offload_type);\n \n+    /* Get hardware-offloads activity counters from a dataplane.\n+     * Those counters are not offload statistics (which are accessible through\n+     * netdev statistics), but a status of hardware offload management:\n+     * how many offloads are currently waiting, inserted, etc. */\n+    int (*offload_stats_get)(struct dpif *dpif,\n+                             struct netdev_custom_stats *stats);\n+\n     /* Enables or disables receiving packets with dpif_recv() for 'dpif'.\n      * Turning packet receive off and then back on is allowed to change Netlink\n      * PID assignments (see ->port_get_pid()).  The client is responsible for\ndiff --git a/lib/dpif.c b/lib/dpif.c\nindex 8c4aed47b..97cca2841 100644\n--- a/lib/dpif.c\n+++ b/lib/dpif.c\n@@ -1427,6 +1427,14 @@ dpif_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops,\n     }\n }\n \n+int dpif_offload_stats_get(struct dpif *dpif,\n+                           struct netdev_custom_stats *stats)\n+{\n+    return (dpif->dpif_class->offload_stats_get\n+            ? dpif->dpif_class->offload_stats_get(dpif, stats)\n+            : EOPNOTSUPP);\n+}\n+\n /* Returns a string that represents 'type', for use in log messages. */\n const char *\n dpif_upcall_type_to_string(enum dpif_upcall_type type)\ndiff --git a/lib/dpif.h b/lib/dpif.h\nindex 7c322d20e..3bb79a78d 100644\n--- a/lib/dpif.h\n+++ b/lib/dpif.h\n@@ -787,6 +787,15 @@ struct dpif_op {\n \n void dpif_operate(struct dpif *, struct dpif_op **ops, size_t n_ops,\n                   enum dpif_offload_type);\n+\n+/* Queries the datapath for hardware offloads stats.\n+ *\n+ * Statistics are written in 'stats' following the 'netdev_custom_stats'\n+ * format. They are allocated on the heap and must be freed by the caller,\n+ * using 'netdev_free_custom_stats_counters'.\n+ */\n+int dpif_offload_stats_get(struct dpif *dpif,\n+                           struct netdev_custom_stats *stats);\n \f\n /* Upcalls. */\n \n",
    "prefixes": [
        "ovs-dev",
        "v5",
        "07/27"
    ]
}