Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/607710/?format=api
{ "id": 607710, "url": "http://patchwork.ozlabs.org/api/patches/607710/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160407225844.28139.2180.stgit@localhost6.localdomain6/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20160407225844.28139.2180.stgit@localhost6.localdomain6>", "list_archive_url": null, "date": "2016-04-07T22:58:44", "name": "[2/2] ixgbevf: add support for per-queue ethtool stats", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "da5e22bdb4ada7616d03c697463752dbb204b319", "submitter": { "id": 1670, "url": "http://patchwork.ozlabs.org/api/people/1670/?format=api", "name": "Tantilov, Emil S", "email": "emil.s.tantilov@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160407225844.28139.2180.stgit@localhost6.localdomain6/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/607710/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/607710/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 3qgygl3PMGz9t3V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Apr 2016 08:58:43 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C52C384942;\n\tThu, 7 Apr 2016 22:58:42 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EafJwsjxdqeV; Thu, 7 Apr 2016 22:58:42 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 48997840C8;\n\tThu, 7 Apr 2016 22:58:42 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 73ABC1C0967\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Apr 2016 22:58:40 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6FD19841CF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Apr 2016 22:58:40 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ZU6a2a5SRStX for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Apr 2016 22:58:39 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D21D9840C8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Apr 2016 22:58:39 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP; 07 Apr 2016 15:58:21 -0700", "from estantil-desk3.jf.intel.com (HELO localhost6.localdomain6)\n\t([134.134.3.186])\n\tby orsmga003.jf.intel.com with ESMTP; 07 Apr 2016 15:58:20 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,449,1455004800\"; d=\"scan'208\";a=\"780412886\"", "From": "Emil Tantilov <emil.s.tantilov@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 07 Apr 2016 15:58:44 -0700", "Message-ID": "<20160407225844.28139.2180.stgit@localhost6.localdomain6>", "In-Reply-To": "<20160407225839.28139.26733.stgit@localhost6.localdomain6>", "References": "<20160407225839.28139.26733.stgit@localhost6.localdomain6>", "User-Agent": "StGit/0.17.1-4-g4a0c1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 2/2] ixgbevf: add support for per-queue\n\tethtool stats", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Implement per-queue statistics for packets, bytes and busy poll\nspecific counters.\n\nSigned-off-by: Emil Tantilov <emil.s.tantilov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ethtool.c | 127 +++++++++++++++++++-------\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 10 --\n 2 files changed, 91 insertions(+), 46 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\nindex cd4d311..64d5c6e 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n@@ -75,14 +75,6 @@ static struct ixgbe_stats ixgbevf_gstrings_stats[] = {\n \tIXGBEVF_STAT(\"tx_timeout_count\", tx_timeout_count),\n \tIXGBEVF_NETDEV_STAT(multicast),\n \tIXGBEVF_STAT(\"rx_csum_offload_errors\", hw_csum_rx_error),\n-#ifdef BP_EXTENDED_STATS\n-\tIXGBEVF_STAT(\"rx_bp_poll_yield\", bp_rx_yields),\n-\tIXGBEVF_STAT(\"rx_bp_cleaned\", bp_rx_cleaned),\n-\tIXGBEVF_STAT(\"rx_bp_misses\", bp_rx_missed),\n-\tIXGBEVF_STAT(\"tx_bp_napi_yield\", bp_tx_yields),\n-\tIXGBEVF_STAT(\"tx_bp_cleaned\", bp_tx_cleaned),\n-\tIXGBEVF_STAT(\"tx_bp_misses\", bp_tx_missed),\n-#endif\n };\n \n #define IXGBEVF_QUEUE_STATS_LEN ( \\\n@@ -389,13 +381,13 @@ clear_reset:\n \treturn err;\n }\n \n-static int ixgbevf_get_sset_count(struct net_device *dev, int stringset)\n+static int ixgbevf_get_sset_count(struct net_device *netdev, int stringset)\n {\n \tswitch (stringset) {\n \tcase ETH_SS_TEST:\n \t\treturn IXGBEVF_TEST_LEN;\n \tcase ETH_SS_STATS:\n-\t\treturn IXGBEVF_GLOBAL_STATS_LEN;\n+\t\treturn IXGBEVF_STATS_LEN;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n@@ -407,34 +399,11 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev,\n \tstruct ixgbevf_adapter *adapter = netdev_priv(netdev);\n \tstruct rtnl_link_stats64 temp;\n \tconst struct rtnl_link_stats64 *net_stats;\n-\tint i;\n+\tunsigned int start;\n+\tstruct ixgbevf_ring *ring;\n+\tint i, j;\n \tchar *p;\n \n-#ifdef BP_EXTENDED_STATS\n-\tu64 rx_yields = 0, rx_cleaned = 0, rx_missed = 0,\n-\t tx_yields = 0, tx_cleaned = 0, tx_missed = 0;\n-\n-\tfor (i = 0; i < adapter->num_rx_queues; i++) {\n-\t\trx_yields += adapter->rx_ring[i]->stats.yields;\n-\t\trx_cleaned += adapter->rx_ring[i]->stats.cleaned;\n-\t\trx_yields += adapter->rx_ring[i]->stats.yields;\n-\t}\n-\n-\tfor (i = 0; i < adapter->num_tx_queues; i++) {\n-\t\ttx_yields += adapter->tx_ring[i]->stats.yields;\n-\t\ttx_cleaned += adapter->tx_ring[i]->stats.cleaned;\n-\t\ttx_yields += adapter->tx_ring[i]->stats.yields;\n-\t}\n-\n-\tadapter->bp_rx_yields = rx_yields;\n-\tadapter->bp_rx_cleaned = rx_cleaned;\n-\tadapter->bp_rx_missed = rx_missed;\n-\n-\tadapter->bp_tx_yields = tx_yields;\n-\tadapter->bp_tx_cleaned = tx_cleaned;\n-\tadapter->bp_tx_missed = tx_missed;\n-#endif\n-\n \tixgbevf_update_stats(adapter);\n \tnet_stats = dev_get_stats(netdev, &temp);\n \tfor (i = 0; i < IXGBEVF_GLOBAL_STATS_LEN; i++) {\n@@ -455,11 +424,68 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev,\n \t\tdata[i] = (ixgbevf_gstrings_stats[i].sizeof_stat ==\n \t\t\t sizeof(u64)) ? *(u64 *)p : *(u32 *)p;\n \t}\n+\n+\t/* populate Tx queue data */\n+\tfor (j = 0; j < adapter->num_tx_queues; j++) {\n+\t\tring = adapter->tx_ring[j];\n+\t\tif (!ring) {\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+#ifdef BP_EXTENDED_STATS\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+#endif\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tdo {\n+\t\t\tstart = u64_stats_fetch_begin_irq(&ring->syncp);\n+\t\t\tdata[i] = ring->stats.packets;\n+\t\t\tdata[i + 1] = ring->stats.bytes;\n+\t\t} while (u64_stats_fetch_retry_irq(&ring->syncp, start));\n+\t\ti += 2;\n+#ifdef BP_EXTENDED_STATS\n+\t\tdata[i] = ring->stats.yields;\n+\t\tdata[i + 1] = ring->stats.misses;\n+\t\tdata[i + 2] = ring->stats.cleaned;\n+\t\ti += 3;\n+#endif\n+\t}\n+\n+\t/* populate Rx queue data */\n+\tfor (j = 0; j < adapter->num_rx_queues; j++) {\n+\t\tring = adapter->rx_ring[j];\n+\t\tif (!ring) {\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+#ifdef BP_EXTENDED_STATS\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+\t\t\tdata[i++] = 0;\n+#endif\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tdo {\n+\t\t\tstart = u64_stats_fetch_begin_irq(&ring->syncp);\n+\t\t\tdata[i] = ring->stats.packets;\n+\t\t\tdata[i + 1] = ring->stats.bytes;\n+\t\t} while (u64_stats_fetch_retry_irq(&ring->syncp, start));\n+\t\ti += 2;\n+#ifdef BP_EXTENDED_STATS\n+\t\tdata[i] = ring->stats.yields;\n+\t\tdata[i + 1] = ring->stats.misses;\n+\t\tdata[i + 2] = ring->stats.cleaned;\n+\t\ti += 3;\n+#endif\n+\t}\n }\n \n static void ixgbevf_get_strings(struct net_device *netdev, u32 stringset,\n \t\t\t\tu8 *data)\n {\n+\tstruct ixgbevf_adapter *adapter = netdev_priv(netdev);\n \tchar *p = (char *)data;\n \tint i;\n \n@@ -474,6 +500,35 @@ static void ixgbevf_get_strings(struct net_device *netdev, u32 stringset,\n \t\t\t ETH_GSTRING_LEN);\n \t\t\tp += ETH_GSTRING_LEN;\n \t\t}\n+\n+\t\tfor (i = 0; i < adapter->num_tx_queues; i++) {\n+\t\t\tsprintf(p, \"tx_queue_%u_packets\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"tx_queue_%u_bytes\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+#ifdef BP_EXTENDED_STATS\n+\t\t\tsprintf(p, \"tx_queue_%u_bp_napi_yield\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"tx_queue_%u_bp_misses\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"tx_queue_%u_bp_cleaned\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+#endif /* BP_EXTENDED_STATS */\n+\t\t}\n+\t\tfor (i = 0; i < adapter->num_rx_queues; i++) {\n+\t\t\tsprintf(p, \"rx_queue_%u_packets\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"rx_queue_%u_bytes\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+#ifdef BP_EXTENDED_STATS\n+\t\t\tsprintf(p, \"rx_queue_%u_bp_poll_yield\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"rx_queue_%u_bp_misses\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\tsprintf(p, \"rx_queue_%u_bp_cleaned\", i);\n+\t\t\tp += ETH_GSTRING_LEN;\n+#endif /* BP_EXTENDED_STATS */\n+\t\t}\n \t\tbreak;\n \t}\n }\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex 5ac60ee..5ca3794 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -422,16 +422,6 @@ struct ixgbevf_adapter {\n \tunsigned int tx_ring_count;\n \tunsigned int rx_ring_count;\n \n-#ifdef BP_EXTENDED_STATS\n-\tu64 bp_rx_yields;\n-\tu64 bp_rx_cleaned;\n-\tu64 bp_rx_missed;\n-\n-\tu64 bp_tx_yields;\n-\tu64 bp_tx_cleaned;\n-\tu64 bp_tx_missed;\n-#endif\n-\n \tu8 __iomem *io_addr; /* Mainly for iounmap use */\n \tu32 link_speed;\n \tbool link_up;\n", "prefixes": [ "2/2" ] }