Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2221025/?format=api
{ "id": 2221025, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221025/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260408171644.1404735-1-i.maximets@ovn.org/", "project": { "id": 47, "url": "http://patchwork.ozlabs.org/api/1.1/projects/47/?format=api", "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" }, "msgid": "<20260408171644.1404735-1-i.maximets@ovn.org>", "date": "2026-04-08T17:16:39", "name": "[ovs-dev] dpif-netdev: Remove pmd-stats-show in favor of pmd-perf-show.", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "ac7d7e441dc8a8ef8e12f40df9bc814b682cc75c", "submitter": { "id": 76798, "url": "http://patchwork.ozlabs.org/api/1.1/people/76798/?format=api", "name": "Ilya Maximets", "email": "i.maximets@ovn.org" }, "delegate": { "id": 81893, "url": "http://patchwork.ozlabs.org/api/1.1/users/81893/?format=api", "username": "ktraynor", "first_name": "Kevin", "last_name": "Traynor", "email": "ktraynor@redhat.com" }, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260408171644.1404735-1-i.maximets@ovn.org/mbox/", "series": [ { "id": 499166, "url": "http://patchwork.ozlabs.org/api/1.1/series/499166/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=499166", "date": "2026-04-08T17:16:39", "name": "[ovs-dev] dpif-netdev: Remove pmd-stats-show in favor of pmd-perf-show.", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499166/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221025/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/2221025/checks/", "tags": {}, "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "ovs-dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "ovs-dev@lists.linuxfoundation.org" ], "Authentication-Results": [ "legolas.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=patchwork.ozlabs.org)", "smtp3.osuosl.org;\n dmarc=none (p=none dis=none) header.from=ovn.org" ], "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 ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frV9R4Yd0z1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 03:16:59 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id CFFAE41003;\n\tWed, 8 Apr 2026 17:16:57 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id M-sBmfw1Sext; Wed, 8 Apr 2026 17:16:55 +0000 (UTC)", "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id EAD4E40FD1;\n\tWed, 8 Apr 2026 17:16:54 +0000 (UTC)", "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id C3998C054A;\n\tWed, 8 Apr 2026 17:16:54 +0000 (UTC)", "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 29ECAC0549\n for <ovs-dev@openvswitch.org>; Wed, 8 Apr 2026 17:16:53 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 1B99B606E5\n for <ovs-dev@openvswitch.org>; Wed, 8 Apr 2026 17:16:53 +0000 (UTC)", "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 9MePSZcbVKbD for <ovs-dev@openvswitch.org>;\n Wed, 8 Apr 2026 17:16:51 +0000 (UTC)", "from mail-wr1-f67.google.com (mail-wr1-f67.google.com\n [209.85.221.67])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 18371606E1\n for <ovs-dev@openvswitch.org>; Wed, 8 Apr 2026 17:16:50 +0000 (UTC)", "by mail-wr1-f67.google.com with SMTP id\n ffacd0b85a97d-43d43e09de5so31306f8f.1\n for <ovs-dev@openvswitch.org>; Wed, 08 Apr 2026 10:16:50 -0700 (PDT)", "from im-t490s.redhat.com (89-24-33-222.nat.epc.tmcz.cz.\n [89.24.33.222]) by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43d1e2c60a2sm58010603f8f.10.2026.04.08.10.16.46\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 08 Apr 2026 10:16:47 -0700 (PDT)" ], "X-Virus-Scanned": [ "amavis at osuosl.org", "amavis at osuosl.org" ], "X-Comment": "SPF check N/A for local connections -\n client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ", "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 smtp4.osuosl.org EAD4E40FD1", "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 18371606E1" ], "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.67;\n helo=mail-wr1-f67.google.com; envelope-from=i.maximets.ovn@gmail.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp3.osuosl.org 18371606E1", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775668609; x=1776273409;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=pi7u+77s8IZ6R7laAXNuWBJrwD/24vsNCvK/eyZPoeU=;\n b=GR/LL7JFgVEJ1LIAVihdrpRNpjvlMMm9LRueOszflUHQ1yUlIdEAocEsC99RZkd3dc\n 1uLSLOiEb0dHY65Id5HV5mSCLoFPDJBQFJM6CpAVO9iQLZ4uxVh2+6wcyN1o5DH+WhF3\n ShJzcOiyOuc2Jw5umoskESrJZ1UHLrXNxYp1p0uPOrdE8+0OSgpebVo1DHJQWOo7yTte\n YMKWDnd6S82PLXLysNjj9vUbfg2dlO0BsSrika6d016I7r6OVgHR+oYBsTJFQN9Rd1qt\n g33hnAHpoUqaGUoHS5++9ry2DBWvLSymF4LIjZBSnplyhYd6A7QS6l+C5AsQgiN5KwqB\n qkEQ==", "X-Gm-Message-State": "AOJu0YxAy7XntdpstoP6lOehapj5OrsWCbIEZUA7poBy5ckcu/814rdM\n sTSCFhUi38VN5YJA4OyGjQbL2/zKXvzMHpPp9e7iASm4qtI5lCc5YhzRXytBr6Eg", "X-Gm-Gg": "AeBDietBltMQXmODJozQ13BuWTxh/A0TQAKYuh6jhFRakMUemy3LnlW49RQScrpAOE9\n zlhVZKl+gtjiplAXNNiz72w7wSTTNke495iNzIFH++ojV68T5yv5iT/BQ0+JJHy7RZMBnlVgVOg\n /oKnMxYAWCahktmnjRNxxymVvvU1NXSpUUMd2xxLgkjIOC/2aS9xmQfw4IJRvKl4tyLaphG1uwx\n Vtuwe9sCU6bXhArzv7AnEiFgzs9hMgHuePde2owXT4cozA8J7G9FMrEpes49sSQeUhl7eYl/B2R\n jEvoH6/ArnrfOi8Klsnwgg8uqv3WaVle0ZF0z8m7RcB6IWQzxGg4VpgAhGMDYUoY8K81wRrn+Kr\n 7TFRZ7kEXlZu3WlqOyCFXKosVbLF0nH68Adx+h8wUVkA467+G55UIGbAX7psynlLCtjtvrXwkW6\n K5coHENsE45j+TUoKwJ2CiF0F15wqWL6eXrQgCtyhO0vg0+4waBZJXXArKdLh4j9yusciblQ==", "X-Received": "by 2002:a05:6000:40dd:b0:43b:8858:1146 with SMTP id\n ffacd0b85a97d-43d292e7fd9mr35016260f8f.41.1775668608537;\n Wed, 08 Apr 2026 10:16:48 -0700 (PDT)", "From": "Ilya Maximets <i.maximets@ovn.org>", "To": "ovs-dev@openvswitch.org", "Date": "Wed, 8 Apr 2026 19:16:39 +0200", "Message-ID": "<20260408171644.1404735-1-i.maximets@ovn.org>", "X-Mailer": "git-send-email 2.53.0", "MIME-Version": "1.0", "Subject": "[ovs-dev] [PATCH] dpif-netdev: Remove pmd-stats-show in favor of\n pmd-perf-show.", "X-BeenThere": "ovs-dev@openvswitch.org", "X-Mailman-Version": "2.1.30", "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>", "Cc": "Ilya Maximets <i.maximets@ovn.org>", "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 'pmd-perf-show' command provides all the same information and more.\nIt is also better visually structured and easier to read as a result.\n\nLet's remove the old 'pmd-stats-show' command, as there is no real need\nto have two commands reporting the same data.\n\nThe only difference until now was that 'pmd-perf-show' didn't provide\ninformation for the \"main\" thread. This change makes it report the\nstatistics for the aggregated \"main\" thread as well, omitting things\nrelated to CPU cycles, as we can't collect those for threads that are\nnot pinned. For the same reason histograms are also always disabled.\nOmission is done by checking the total number of iterations to be zero.\n\"main\" thread doesn't start/end iterations.\n\nThe actual unixctl command is preserved undocumented and serves as an\nalias for 'pmd-perf-show'. This should allow old scripts that are just\ncapturing the output for humans (or LLMs?) to read to keep working.\nNote, however, that the exact output format for unixctl commands was\nnever a guarantee, so scripts that attempt to parse the output may\nstill break.\n\nSigned-off-by: Ilya Maximets <i.maximets@ovn.org>\n---\n\nNote: I believe the change in system-dpdk-offloads.at is correct,\n but I didn't run the testsuite, as I have no hardware for it.\n\n Documentation/intro/install/afxdp.rst | 2 +-\n Documentation/intro/install/dpdk.rst | 2 +-\n Documentation/topics/dpdk/bridge.rst | 4 +-\n Documentation/topics/dpdk/pmd.rst | 4 -\n NEWS | 4 +\n lib/dpif-netdev-perf.c | 39 +++--\n lib/dpif-netdev-perf.h | 2 +-\n lib/dpif-netdev-unixctl.man | 62 ++++---\n lib/dpif-netdev.c | 158 ++++--------------\n tests/dpif-netdev.at | 20 +--\n tests/pmd.at | 47 +++---\n tests/system-dpdk-offloads.at | 8 +-\n .../plugins/system-logs/openvswitch.xml | 2 +-\n 13 files changed, 136 insertions(+), 218 deletions(-)", "diff": "diff --git a/Documentation/intro/install/afxdp.rst b/Documentation/intro/install/afxdp.rst\nindex 63a10e328..07225a885 100644\n--- a/Documentation/intro/install/afxdp.rst\n+++ b/Documentation/intro/install/afxdp.rst\n@@ -273,7 +273,7 @@ Measure your system call rate by doing::\n \n Or, use OVS pmd tool::\n \n- ovs-appctl dpif-netdev/pmd-stats-show\n+ ovs-appctl dpif-netdev/pmd-perf-show\n \n \n Example Script\ndiff --git a/Documentation/intro/install/dpdk.rst b/Documentation/intro/install/dpdk.rst\nindex 6f4687bde..d5c897e8b 100644\n--- a/Documentation/intro/install/dpdk.rst\n+++ b/Documentation/intro/install/dpdk.rst\n@@ -709,7 +709,7 @@ level:\n \n The average number of packets per output batch can be checked in PMD stats::\n \n- $ ovs-appctl dpif-netdev/pmd-stats-show\n+ $ ovs-appctl dpif-netdev/pmd-perf-show\n \n Limitations\n ------------\ndiff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst\nindex 03c4dd4e3..4468b904b 100644\n--- a/Documentation/topics/dpdk/bridge.rst\n+++ b/Documentation/topics/dpdk/bridge.rst\n@@ -103,7 +103,7 @@ the packet itself and others (for example, VLAN tag or Ethernet type) can be\n extracted without fully parsing the packet. This allows OVS to significantly\n speed up packet forwarding for these flows with simple match criteria.\n Statistics on the number of packets matched in this way can be found in a\n-`simple match hits` counter of `ovs-appctl dpif-netdev/pmd-stats-show` command.\n+`Simple Match hits` counter of `ovs-appctl dpif-netdev/pmd-perf-show` command.\n \n EMC Insertion Probability\n -------------------------\n@@ -127,7 +127,7 @@ If ``N`` is set to 1, an insertion will be performed for every flow. If set to\n With default ``N`` set to 100, higher megaflow hits will occur initially as\n observed with pmd stats::\n \n- $ ovs-appctl dpif-netdev/pmd-stats-show\n+ $ ovs-appctl dpif-netdev/pmd-perf-show\n \n For certain traffic profiles with many parallel flows, it's recommended to set\n ``N`` to '0' to achieve higher forwarding performance.\ndiff --git a/Documentation/topics/dpdk/pmd.rst b/Documentation/topics/dpdk/pmd.rst\nindex 2e8cf5edb..1589d521c 100644\n--- a/Documentation/topics/dpdk/pmd.rst\n+++ b/Documentation/topics/dpdk/pmd.rst\n@@ -57,10 +57,6 @@ PMD Thread Statistics\n \n To show current stats::\n \n- $ ovs-appctl dpif-netdev/pmd-stats-show\n-\n-or::\n-\n $ ovs-appctl dpif-netdev/pmd-perf-show\n \n Detailed performance metrics for ``pmd-perf-show`` can also be enabled::\ndiff --git a/NEWS b/NEWS\nindex 1a3044cbf..b35bcff6e 100644\n--- a/NEWS\n+++ b/NEWS\n@@ -3,6 +3,10 @@ Post-v3.7.0\n - Userspace datapath:\n * ARP/ND lookups for native tunnel are now rate limited. The holdout\n timer can be configured with 'tnl/neigh/retrans_time'.\n+ - ovs-appctl:\n+ * 'dpif-netdev/pmd-stats-show' command was removed in favor of the more\n+ informative and better structured 'dpif-netdev/pmd-perf-show', which\n+ now also provides statistics for the \"main\" thread.\n \n \n v3.7.0 - 16 Feb 2026\ndiff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c\nindex 1cd4ee084..ba370d7c1 100644\n--- a/lib/dpif-netdev-perf.c\n+++ b/lib/dpif-netdev-perf.c\n@@ -233,7 +233,8 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,\n uint64_t sleep_iter = stats[PMD_SLEEP_ITER];\n uint64_t tot_sleep_cycles = stats[PMD_CYCLES_SLEEP];\n \n- ds_put_format(str,\n+ if (tot_iter) {\n+ ds_put_format(str,\n \" Iterations: %12\"PRIu64\" (%.2f us/it)\\n\"\n \" - Used TSC cycles: %12\"PRIu64\" (%5.1f %% of total cycles)\\n\"\n \" - idle iterations: %12\"PRIu64\" (%5.1f %% of used cycles)\\n\"\n@@ -252,9 +253,18 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,\n sleep_iter, tot_iter ? 100.0 * sleep_iter / tot_iter : 0,\n tot_sleep_cycles * us_per_cycle,\n sleep_iter ? (tot_sleep_cycles * us_per_cycle) / sleep_iter : 0);\n+ }\n if (rx_packets > 0) {\n ds_put_format(str,\n- \" Rx packets: %12\"PRIu64\" (%.0f Kpps, %.0f cycles/pkt)\\n\"\n+ \" Rx packets: %12\"PRIu64\" (%.0f Kpps\",\n+ rx_packets, (rx_packets / duration) / 1000);\n+ if (tot_iter) {\n+ ds_put_format(str, \", %.0f cycles/pkt\",\n+ 1.0 * stats[PMD_CYCLES_ITER_BUSY] / rx_packets);\n+ }\n+ ds_put_cstr(str, \")\\n\");\n+\n+ ds_put_format(str,\n \" Datapath passes: %12\"PRIu64\" (%.2f passes/pkt)\\n\"\n \" - PHWOL hits: %12\"PRIu64\" (%5.1f %%)\\n\"\n \" - MFEX Opt hits: %12\"PRIu64\" (%5.1f %%)\\n\"\n@@ -262,11 +272,7 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,\n \" - EMC hits: %12\"PRIu64\" (%5.1f %%)\\n\"\n \" - SMC hits: %12\"PRIu64\" (%5.1f %%)\\n\"\n \" - Megaflow hits: %12\"PRIu64\" (%5.1f %%, %.2f \"\n- \"subtbl lookups/hit)\\n\"\n- \" - Upcalls: %12\"PRIu64\" (%5.1f %%, %.1f us/upcall)\\n\"\n- \" - Lost upcalls: %12\"PRIu64\" (%5.1f %%)\\n\",\n- rx_packets, (rx_packets / duration) / 1000,\n- 1.0 * stats[PMD_CYCLES_ITER_BUSY] / rx_packets,\n+ \"subtbl lookups/hit)\\n\",\n passes, 1.0 * passes / rx_packets,\n stats[PMD_STAT_PHWOL_HIT],\n 100.0 * stats[PMD_STAT_PHWOL_HIT] / passes,\n@@ -282,11 +288,20 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,\n 100.0 * stats[PMD_STAT_MASKED_HIT] / passes,\n stats[PMD_STAT_MASKED_HIT]\n ? 1.0 * stats[PMD_STAT_MASKED_LOOKUP] / stats[PMD_STAT_MASKED_HIT]\n- : 0,\n- upcalls, 100.0 * upcalls / passes,\n- upcalls ? (upcall_cycles * us_per_cycle) / upcalls : 0,\n- stats[PMD_STAT_LOST],\n- 100.0 * stats[PMD_STAT_LOST] / passes);\n+ : 0);\n+\n+ ds_put_format(str,\n+ \" - Upcalls: %12\"PRIu64\" (%5.1f %%\",\n+ upcalls, 100.0 * upcalls / passes);\n+ if (tot_iter) {\n+ ds_put_format(str, \", %.1f us/upcall\",\n+ upcalls ? (upcall_cycles * us_per_cycle) / upcalls : 0);\n+ }\n+ ds_put_cstr(str, \")\\n\");\n+\n+ ds_put_format(str,\n+ \" - Lost upcalls: %12\"PRIu64\" (%5.1f %%)\\n\",\n+ stats[PMD_STAT_LOST], 100.0 * stats[PMD_STAT_LOST] / passes);\n } else {\n ds_put_format(str,\n \" Rx packets: %12d\\n\", 0);\ndiff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h\nindex 84beced15..8a41afa8a 100644\n--- a/lib/dpif-netdev-perf.h\n+++ b/lib/dpif-netdev-perf.h\n@@ -317,7 +317,7 @@ void pmd_perf_read_counters(struct pmd_perf_stats *s,\n * NON-PMD they might be updated from multiple threads, but we can live\n * with losing a rare update as 100% accuracy is not required.\n * However, as counters are read for display from outside the PMD thread\n- * with e.g. pmd-stats-show, we make sure that the 64-bit read and store\n+ * with e.g. pmd-perf-show, we make sure that the 64-bit read and store\n * operations are atomic also on 32-bit systems so that readers cannot\n * not read garbage. On 64-bit systems this incurs no overhead. */\n \ndiff --git a/lib/dpif-netdev-unixctl.man b/lib/dpif-netdev-unixctl.man\nindex 8cd847416..3d5ab437c 100644\n--- a/lib/dpif-netdev-unixctl.man\n+++ b/lib/dpif-netdev-unixctl.man\n@@ -6,44 +6,22 @@ argument can be omitted. By default the commands present data for all pmd\n threads in the datapath. By specifying the \"-pmd Core\" option one can filter\n the output for a single pmd in the datapath.\n .\n-.IP \"\\fBdpif-netdev/pmd-stats-show\\fR [\\fB-pmd\\fR \\fIcore\\fR] [\\fIdp\\fR]\"\n-Shows performance statistics for one or all pmd threads of the datapath\n-\\fIdp\\fR. The special thread \"main\" sums up the statistics of every non pmd\n-thread.\n-\n-The sum of \"phwol hits\", \"simple match hits\", \"emc hits\", \"smc hits\",\n-\"megaflow hits\" and \"miss\" is the number of packet lookups performed by the\n-datapath. Beware that a recirculated packet experiences one additional lookup\n-per recirculation, so there may be more lookups than forwarded packets in the\n-datapath.\n-\n-The MFEX Opt hits displays the number of packets that are processed by the\n-optimized miniflow extract implementations.\n-\n-Cycles are counted using the TSC or similar facilities (when available on\n-the platform). The duration of one cycle depends on the processing platform.\n-\n-\"idle cycles\" refers to cycles spent in PMD iterations not forwarding any\n-any packets. \"processing cycles\" refers to cycles spent in PMD iterations\n-forwarding at least one packet, including the cost for polling, processing and\n-transmitting said packets.\n-\n-To reset these counters use \\fBdpif-netdev/pmd-stats-clear\\fR.\n-.\n .IP \"\\fBdpif-netdev/pmd-stats-clear\\fR [\\fIdp\\fR]\"\n Resets to zero the per pmd thread performance numbers shown by the\n-\\fBdpif-netdev/pmd-stats-show\\fR and \\fBdpif-netdev/pmd-perf-show\\fR commands.\n-It will NOT reset datapath or bridge statistics, only the values shown by\n-the above commands.\n+\\fBdpif-netdev/pmd-perf-show\\fR command. It will NOT reset datapath or bridge\n+statistics, only the values shown by the above command.\n .\n .IP \"\\fBdpif-netdev/pmd-perf-show\\fR [\\fB-nh\\fR] [\\fB-it\\fR \\fIiter_len\\fR] \\\n [\\fB-ms\\fR \\fIms_len\\fR] [\\fB-pmd\\fR \\fIcore\\fR] [\\fIdp\\fR]\"\n Shows detailed performance metrics for one or all pmds threads of the\n-user space datapath.\n+user space datapath. The special thread \"main\" sums up the statistics of every\n+non pmd thread.\n \n-The collection of detailed statistics can be controlled by a new\n-configuration parameter \"other_config:pmd-perf-metrics\". By default it\n-is disabled. The run-time overhead, when enabled, is in the order of 1%.\n+The collection of additional detailed statistics can be controlled by a\n+configuration parameter \\fBother-config:pmd-perf-metrics\\fR. By default it is\n+disabled. The run-time overhead, when enabled, is in the order of 1%.\n+\n+Collected statistics include:\n \n .RS\n .IP\n@@ -153,8 +131,26 @@ pmd thread numa_id 0 core_id 1:\n .RE\n .IP\n Here \"Rx packets\" actually reflects the number of packets forwarded by the\n-datapath. \"Datapath passes\" matches the number of packet lookups as\n-reported by the \\fBdpif-netdev/pmd-stats-show\\fR command.\n+datapath.\n+\n+The sum of \"PHWOL hits\", \"Simple Match hits\", \"EMC hits\", \"SMC hits\",\n+\"Megaflow hits\" and \"Upcalls\" is the number of packet lookups performed by the\n+datapath and it is reported as \"Datapath passes\". Beware that a recirculated\n+packet experiences one additional lookup per recirculation, so there may be\n+more lookups than forwarded packets in the datapath.\n+\n+The \"MFEX Opt hits\" displays the number of packets that are processed by the\n+optimized miniflow extract implementations.\n+\n+Cycles are counted using the TSC or similar facilities (when available on\n+the platform). The duration of one cycle depends on the processing platform.\n+Statistics based on cycles are not reported for the \"main\" thread, since the\n+accurate accounting of CPU cycles is not possible in this case.\n+\n+\"idle iterations\" refers to PMD iterations that didn't not result in processing\n+any packets. \"busy iterations\" refers to PMD iterations that included\n+processing of at least one packet. The reported used TSC cycles include the\n+cost for polling, processing and transmitting said packets.\n \n To reset the counters and start a new measurement use\n \\fBdpif-netdev/pmd-stats-clear\\fR.\ndiff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c\nindex 9df05c4c2..db5823a91 100644\n--- a/lib/dpif-netdev.c\n+++ b/lib/dpif-netdev.c\n@@ -620,8 +620,7 @@ get_dp_netdev(const struct dpif *dpif)\n }\n \f\n enum pmd_info_type {\n- PMD_INFO_SHOW_STATS, /* Show how cpu cycles are spent. */\n- PMD_INFO_CLEAR_STATS, /* Set the cycles count to 0. */\n+ PMD_INFO_CLEAR_STATS, /* Set the cycle and the packet counters to 0. */\n PMD_INFO_SHOW_RXQ, /* Show poll lists of pmd threads. */\n PMD_INFO_PERF_SHOW, /* Show pmd performance details. */\n PMD_INFO_SLEEP_SHOW, /* Show max sleep configuration details. */\n@@ -641,127 +640,42 @@ format_pmd_thread(struct ds *reply, struct dp_netdev_pmd_thread *pmd)\n ds_put_cstr(reply, \":\\n\");\n }\n \n-static void\n-pmd_info_show_stats(struct ds *reply,\n- struct dp_netdev_pmd_thread *pmd)\n-{\n- uint64_t stats[PMD_N_STATS];\n- uint64_t total_cycles, total_packets;\n- double passes_per_pkt = 0;\n- double lookups_per_hit = 0;\n- double packets_per_batch = 0;\n-\n- pmd_perf_read_counters(&pmd->perf_stats, stats);\n- total_cycles = stats[PMD_CYCLES_ITER_IDLE]\n- + stats[PMD_CYCLES_ITER_BUSY];\n- total_packets = stats[PMD_STAT_RECV];\n-\n- format_pmd_thread(reply, pmd);\n-\n- if (total_packets > 0) {\n- passes_per_pkt = (total_packets + stats[PMD_STAT_RECIRC])\n- / (double) total_packets;\n- }\n- if (stats[PMD_STAT_MASKED_HIT] > 0) {\n- lookups_per_hit = stats[PMD_STAT_MASKED_LOOKUP]\n- / (double) stats[PMD_STAT_MASKED_HIT];\n- }\n- if (stats[PMD_STAT_SENT_BATCHES] > 0) {\n- packets_per_batch = stats[PMD_STAT_SENT_PKTS]\n- / (double) stats[PMD_STAT_SENT_BATCHES];\n- }\n-\n- ds_put_format(reply,\n- \" packets received: %\"PRIu64\"\\n\"\n- \" packet recirculations: %\"PRIu64\"\\n\"\n- \" avg. datapath passes per packet: %.02f\\n\"\n- \" phwol hits: %\"PRIu64\"\\n\"\n- \" mfex opt hits: %\"PRIu64\"\\n\"\n- \" simple match hits: %\"PRIu64\"\\n\"\n- \" emc hits: %\"PRIu64\"\\n\"\n- \" smc hits: %\"PRIu64\"\\n\"\n- \" megaflow hits: %\"PRIu64\"\\n\"\n- \" avg. subtable lookups per megaflow hit: %.02f\\n\"\n- \" miss with success upcall: %\"PRIu64\"\\n\"\n- \" miss with failed upcall: %\"PRIu64\"\\n\"\n- \" avg. packets per output batch: %.02f\\n\",\n- total_packets, stats[PMD_STAT_RECIRC],\n- passes_per_pkt, stats[PMD_STAT_PHWOL_HIT],\n- stats[PMD_STAT_MFEX_OPT_HIT],\n- stats[PMD_STAT_SIMPLE_HIT],\n- stats[PMD_STAT_EXACT_HIT],\n- stats[PMD_STAT_SMC_HIT],\n- stats[PMD_STAT_MASKED_HIT],\n- lookups_per_hit, stats[PMD_STAT_MISS], stats[PMD_STAT_LOST],\n- packets_per_batch);\n-\n- if (total_cycles == 0) {\n- return;\n- }\n-\n- ds_put_format(reply,\n- \" idle cycles: %\"PRIu64\" (%.02f%%)\\n\"\n- \" processing cycles: %\"PRIu64\" (%.02f%%)\\n\",\n- stats[PMD_CYCLES_ITER_IDLE],\n- stats[PMD_CYCLES_ITER_IDLE] / (double) total_cycles * 100,\n- stats[PMD_CYCLES_ITER_BUSY],\n- stats[PMD_CYCLES_ITER_BUSY] / (double) total_cycles * 100);\n-\n- if (total_packets == 0) {\n- return;\n- }\n-\n- ds_put_format(reply,\n- \" avg cycles per packet: %.02f (%\"PRIu64\"/%\"PRIu64\")\\n\",\n- total_cycles / (double) total_packets,\n- total_cycles, total_packets);\n-\n- ds_put_format(reply,\n- \" avg processing cycles per packet: \"\n- \"%.02f (%\"PRIu64\"/%\"PRIu64\")\\n\",\n- stats[PMD_CYCLES_ITER_BUSY] / (double) total_packets,\n- stats[PMD_CYCLES_ITER_BUSY], total_packets);\n-}\n-\n static void\n pmd_info_show_perf(struct ds *reply,\n struct dp_netdev_pmd_thread *pmd,\n struct pmd_perf_params *par)\n {\n- if (pmd->core_id != NON_PMD_CORE_ID) {\n- char *time_str =\n- xastrftime_msec(\"%H:%M:%S.###\", time_wall_msec(), true);\n- long long now = time_msec();\n- double duration = (now - pmd->perf_stats.start_ms) / 1000.0;\n-\n- ds_put_cstr(reply, \"\\n\");\n- ds_put_format(reply, \"Time: %s\\n\", time_str);\n- ds_put_format(reply, \"Measurement duration: %.3f s\\n\", duration);\n- ds_put_cstr(reply, \"\\n\");\n- format_pmd_thread(reply, pmd);\n- ds_put_cstr(reply, \"\\n\");\n- pmd_perf_format_overall_stats(reply, &pmd->perf_stats, duration);\n- if (pmd_perf_metrics_enabled(pmd)) {\n- /* Prevent parallel clearing of perf metrics. */\n- ovs_mutex_lock(&pmd->perf_stats.clear_mutex);\n- if (par->histograms) {\n- ds_put_cstr(reply, \"\\n\");\n- pmd_perf_format_histograms(reply, &pmd->perf_stats);\n- }\n- if (par->iter_hist_len > 0) {\n- ds_put_cstr(reply, \"\\n\");\n- pmd_perf_format_iteration_history(reply, &pmd->perf_stats,\n- par->iter_hist_len);\n- }\n- if (par->ms_hist_len > 0) {\n- ds_put_cstr(reply, \"\\n\");\n- pmd_perf_format_ms_history(reply, &pmd->perf_stats,\n- par->ms_hist_len);\n- }\n- ovs_mutex_unlock(&pmd->perf_stats.clear_mutex);\n+ char *time_str = xastrftime_msec(\"%H:%M:%S.###\", time_wall_msec(), true);\n+ long long now = time_msec();\n+ double duration = (now - pmd->perf_stats.start_ms) / 1000.0;\n+\n+ ds_put_cstr(reply, \"\\n\");\n+ ds_put_format(reply, \"Time: %s\\n\", time_str);\n+ ds_put_format(reply, \"Measurement duration: %.3f s\\n\", duration);\n+ ds_put_cstr(reply, \"\\n\");\n+ format_pmd_thread(reply, pmd);\n+ ds_put_cstr(reply, \"\\n\");\n+ pmd_perf_format_overall_stats(reply, &pmd->perf_stats, duration);\n+ if (pmd_perf_metrics_enabled(pmd) && pmd->core_id != NON_PMD_CORE_ID) {\n+ /* Prevent parallel clearing of perf metrics. */\n+ ovs_mutex_lock(&pmd->perf_stats.clear_mutex);\n+ if (par->histograms) {\n+ ds_put_cstr(reply, \"\\n\");\n+ pmd_perf_format_histograms(reply, &pmd->perf_stats);\n }\n- free(time_str);\n+ if (par->iter_hist_len > 0) {\n+ ds_put_cstr(reply, \"\\n\");\n+ pmd_perf_format_iteration_history(reply, &pmd->perf_stats,\n+ par->iter_hist_len);\n+ }\n+ if (par->ms_hist_len > 0) {\n+ ds_put_cstr(reply, \"\\n\");\n+ pmd_perf_format_ms_history(reply, &pmd->perf_stats,\n+ par->ms_hist_len);\n+ }\n+ ovs_mutex_unlock(&pmd->perf_stats.clear_mutex);\n }\n+ free(time_str);\n }\n \n static int\n@@ -1443,8 +1357,6 @@ dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[],\n pmd_info_show_rxq(&reply, pmd, secs);\n } else if (type == PMD_INFO_CLEAR_STATS) {\n pmd_perf_stats_clear(&pmd->perf_stats);\n- } else if (type == PMD_INFO_SHOW_STATS) {\n- pmd_info_show_stats(&reply, pmd);\n } else if (type == PMD_INFO_PERF_SHOW) {\n pmd_info_show_perf(&reply, pmd, (struct pmd_perf_params *)aux);\n } else if (type == PMD_INFO_SLEEP_SHOW) {\n@@ -1554,14 +1466,10 @@ dpif_netdev_bond_show(struct unixctl_conn *conn, int argc,\n static int\n dpif_netdev_init(void)\n {\n- static enum pmd_info_type show_aux = PMD_INFO_SHOW_STATS,\n- clear_aux = PMD_INFO_CLEAR_STATS,\n+ static enum pmd_info_type clear_aux = PMD_INFO_CLEAR_STATS,\n poll_aux = PMD_INFO_SHOW_RXQ,\n sleep_aux = PMD_INFO_SLEEP_SHOW;\n \n- unixctl_command_register(\"dpif-netdev/pmd-stats-show\", \"[-pmd core] [dp]\",\n- 0, 3, dpif_netdev_pmd_info,\n- (void *)&show_aux);\n unixctl_command_register(\"dpif-netdev/pmd-stats-clear\", \"[-pmd core] [dp]\",\n 0, 3, dpif_netdev_pmd_info,\n (void *)&clear_aux);\n@@ -1578,6 +1486,10 @@ dpif_netdev_init(void)\n \" [-pmd core] [dp]\",\n 0, 8, pmd_perf_show_cmd,\n NULL);\n+ /* 'pmd-stats-show' is just an undocumented alias for 'pmd-perf-show',\n+ * for compatibility with old muscle memory. */\n+ unixctl_command_register(\"dpif-netdev/pmd-stats-show\", NULL,\n+ 0, 8, pmd_perf_show_cmd, NULL);\n unixctl_command_register(\"dpif-netdev/pmd-rxq-rebalance\", \"[dp]\",\n 0, 1, dpif_netdev_pmd_rebalance,\n NULL);\ndiff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at\nindex 231197970..405094856 100644\n--- a/tests/dpif-netdev.at\n+++ b/tests/dpif-netdev.at\n@@ -979,32 +979,32 @@ AT_CHECK([cat good_frame | sed -e \"s/6b72/dead/\" > bad_frame])\n \n CHECK_FWD_PACKET(p1, p2, , [bad_frame], [bad_frame])\n dnl First packet, no simple matching.\n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | grep 'simple match hits'], [0], [dnl\n- simple match hits: 0\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | grep 'Simple Match hits'], [0], [dnl\n+ - Simple Match hits: 0 ( 0.0 %)\n ])\n \n dnl No Rx flag.\n CHECK_FWD_PACKET(p1, p2, , [bad_frame], [bad_frame])\n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | grep 'simple match hits'], [0], [dnl\n- simple match hits: 1\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | grep 'Simple Match hits'], [0], [dnl\n+ - Simple Match hits: 1 ( 50.0 %)\n ])\n \n dnl Flag as Rx good.\n CHECK_FWD_PACKET(p1, p2, ol_l4_rx_csum_set_good, [bad_frame], [bad_frame])\n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | grep 'simple match hits'], [0], [dnl\n- simple match hits: 2\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | grep 'Simple Match hits'], [0], [dnl\n+ - Simple Match hits: 2 ( 66.7 %)\n ])\n \n dnl Flag as Rx bad.\n CHECK_FWD_PACKET(p1, p2, ol_l4_rx_csum_set_bad, [bad_frame], [bad_frame])\n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | grep 'simple match hits'], [0], [dnl\n- simple match hits: 3\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | grep 'Simple Match hits'], [0], [dnl\n+ - Simple Match hits: 3 ( 75.0 %)\n ])\n \n dnl Flag as Rx partial.\n CHECK_FWD_PACKET(p1, p2, ol_l4_rx_csum_set_partial, [bad_frame], [good_frame])\n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | grep 'simple match hits'], [0], [dnl\n- simple match hits: 4\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | grep 'Simple Match hits'], [0], [dnl\n+ - Simple Match hits: 4 ( 80.0 %)\n ])\n \n OVS_VSWITCHD_STOP\ndiff --git a/tests/pmd.at b/tests/pmd.at\nindex 8254ac3b0..e8590044a 100644\n--- a/tests/pmd.at\n+++ b/tests/pmd.at\n@@ -440,20 +440,12 @@ dummy@ovs-dummy: hit:0 missed:0\n p0 7/1: (dummy-pmd: n_rxq=4, n_txq=1, numa_id=0)\n ])\n \n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 12], [0], [dnl\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | sed SED_NUMA_CORE_PATTERN \\\n+ | sed '/cycles/d' | sed '/[[Ii]]teration/d' | grep pmd -A 3], [0], [dnl\n pmd thread numa_id <cleared> core_id <cleared>:\n- packets received: 0\n- packet recirculations: 0\n- avg. datapath passes per packet: 0.00\n- phwol hits: 0\n- mfex opt hits: 0\n- simple match hits: 0\n- emc hits: 0\n- smc hits: 0\n- megaflow hits: 0\n- avg. subtable lookups per megaflow hit: 0.00\n- miss with success upcall: 0\n- miss with failed upcall: 0\n+\n+ Rx packets: 0\n+ Tx packets: 0\n ])\n \n ovs-appctl time/stop\n@@ -474,20 +466,23 @@ AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl\n recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(frag=no), actions: <del>\n ])\n \n-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 12], [0], [dnl\n+AT_CHECK([ovs-appctl dpif-netdev/pmd-perf-show | sed SED_NUMA_CORE_PATTERN \\\n+ | sed '/cycles/d' | sed '/[[Ii]]teration/d' \\\n+ | sed 's/, .* us/, <cleared> us/' \\\n+ | sed 's/[[0-9]]* Kpps/<cleared> Kpps/' | grep pmd -A 12], [0], [dnl\n pmd thread numa_id <cleared> core_id <cleared>:\n- packets received: 20\n- packet recirculations: 0\n- avg. datapath passes per packet: 1.00\n- phwol hits: 0\n- mfex opt hits: 0\n- simple match hits: 0\n- emc hits: 19\n- smc hits: 0\n- megaflow hits: 0\n- avg. subtable lookups per megaflow hit: 0.00\n- miss with success upcall: 1\n- miss with failed upcall: 0\n+\n+ Datapath passes: 20 (1.00 passes/pkt)\n+ - PHWOL hits: 0 ( 0.0 %)\n+ - MFEX Opt hits: 0 ( 0.0 %)\n+ - Simple Match hits: 0 ( 0.0 %)\n+ - EMC hits: 19 ( 95.0 %)\n+ - SMC hits: 0 ( 0.0 %)\n+ - Megaflow hits: 0 ( 0.0 %, 0.00 subtbl lookups/hit)\n+ - Upcalls: 1 ( 5.0 %, <cleared> us/upcall)\n+ - Lost upcalls: 0 ( 0.0 %)\n+ Tx packets: 20 (<cleared> Kpps)\n+ Tx batches: 20 (1.00 pkts/batch)\n ])\n \n OVS_VSWITCHD_STOP\ndiff --git a/tests/system-dpdk-offloads.at b/tests/system-dpdk-offloads.at\nindex 81ab89b2f..09bdaf639 100644\n--- a/tests/system-dpdk-offloads.at\n+++ b/tests/system-dpdk-offloads.at\n@@ -144,8 +144,8 @@ AT_CHECK([ovs-appctl dpctl/dump-flows type=dpdk,partially-offloaded \\\n in_port(2),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:954, used:0.0s, actions:check_pkt_len(size=200,gt(4),le(5)),3\n ])\n \n-AT_CHECK([test $(ovs-appctl dpif-netdev/pmd-stats-show | \\\n- awk '/phwol hits:/ {sum += $3} END {print sum}') -ge 8])\n+AT_CHECK([test $(ovs-appctl dpif-netdev/pmd-perf-show | \\\n+ awk '/PHWOL hits:/ {sum += $4} END {print sum}') -ge 8])\n \n OVS_TRAFFIC_VSWITCHD_STOP\n AT_CLEANUP\n@@ -216,8 +216,8 @@ OVS_WAIT_UNTIL_EQUAL(\n in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:50, bytes:3000, used:0.0s, actions:ovs-p1\n in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:50, bytes:3000, used:0.0s, actions:ovs-p0])\n \n-AT_CHECK([test $(ovs-appctl dpif-netdev/pmd-stats-show | \\\n- awk '/packets received:/ {sum += $3} END {print sum}') -lt 10])\n+AT_CHECK([test $(ovs-appctl dpif-netdev/pmd-perf-show | \\\n+ awk '/Rx packets:/ {sum += $3} END {print sum}') -lt 10])\n \n OVS_TRAFFIC_VSWITCHD_STOP\n AT_CLEANUP\ndiff --git a/utilities/bugtool/plugins/system-logs/openvswitch.xml b/utilities/bugtool/plugins/system-logs/openvswitch.xml\nindex 46c731812..0f17add75 100644\n--- a/utilities/bugtool/plugins/system-logs/openvswitch.xml\n+++ b/utilities/bugtool/plugins/system-logs/openvswitch.xml\n@@ -20,7 +20,7 @@\n <directory label=\"ovsdb-backups\" filters=\"ovs\" pattern=\".*/conf.db.backup[0-9][^/]*$\">/etc/openvswitch</directory>\n <directory label=\"ovsdb-backups2\" filters=\"ovs\" pattern=\".*/conf.db.backup[0-9][^/]*$\">/var/lib/openvswitch</directory>\n <command label=\"system_memory_status\" filters=\"ovs\">df -h</command>\n- <command label=\"check_number_of_pmds\" filters=\"ovs\">ovs-appctl dpif-netdev/pmd-stats-show | grep pmd</command>\n+ <command label=\"check_number_of_pmds\" filters=\"ovs\">ovs-appctl dpif-netdev/pmd-perf-show | grep pmd</command>\n <command label=\"ovs-appctl-vlog-list\" filters=\"ovs\">ovs-appctl vlog/list</command>\n <command label=\"journalctl\" filters=\"ovs\">journalctl</command>\n <command label=\"user_limits\" filters=\"ovs\">ulimit -a</command>\n", "prefixes": [ "ovs-dev" ] }