Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/493928/?format=api
{ "id": 493928, "url": "http://patchwork.ozlabs.org/api/patches/493928/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1436571370-103673-7-git-send-email-catherine.sullivan@intel.com/", "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": "<1436571370-103673-7-git-send-email-catherine.sullivan@intel.com>", "list_archive_url": null, "date": "2015-07-10T23:36:02", "name": "[next,S8,07/15] i40e/i40evf: Add capability to gather VEB per TC stats", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6df74f29f628797ceecfc3e87ca30d3cbd13157b", "submitter": { "id": 13931, "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api", "name": "Catherine Sullivan", "email": "catherine.sullivan@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/1436571370-103673-7-git-send-email-catherine.sullivan@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/493928/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/493928/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 7EEF41402B4\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 11 Jul 2015 09:34:06 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8C4378B8DE;\n\tFri, 10 Jul 2015 23:34:05 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OK57o3zBUoft; Fri, 10 Jul 2015 23:34:02 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B34348BB7E;\n\tFri, 10 Jul 2015 23:34:01 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3A24D1CE5B5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Jul 2015 23:33:59 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 373B6938F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Jul 2015 23:33:59 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id RtNumgtaPhTv for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Jul 2015 23:33:58 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C49DA93919\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 10 Jul 2015 23:33:57 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP; 10 Jul 2015 16:33:43 -0700", "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby orsmga001.jf.intel.com with ESMTP; 10 Jul 2015 16:33:43 -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.15,450,1432623600\"; d=\"scan'208\";a=\"726728095\"", "From": "Catherine Sullivan <catherine.sullivan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 10 Jul 2015 19:36:02 -0400", "Message-Id": "<1436571370-103673-7-git-send-email-catherine.sullivan@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1436571370-103673-1-git-send-email-catherine.sullivan@intel.com>", "References": "<1436571370-103673-1-git-send-email-catherine.sullivan@intel.com>", "Cc": "Neerav Parikh <Neerav.Parikh@intel.com>", "Subject": "[Intel-wired-lan] [intel-wired-lan][next PATCH S8 07/15]\n\ti40e/i40evf: Add capability to gather VEB per TC 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>", "MIME-Version": "1.0", "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": "From: Neerav Parikh <Neerav.Parikh@intel.com>\n\nThis patch adds capability to update per VEB per TC statistics and dump\nit via ethtool. It also adds a structure to hold VEB per TC statistics.\nThe fields can be filled by reading the GLVEBTC_* counters.\n\nSigned-off-by: Neerav Parikh <Neerav.Parikh@intel.com>\nChange-ID: I28b4759b9ab6ad5a61f046a1bc9ef6b16fe31538\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 2 ++\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 23 ++++++++++++++++++++-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 28 +++++++++++++++++++++++++-\n drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ++++++++\n drivers/net/ethernet/intel/i40evf/i40e_type.h | 8 ++++++++\n 5 files changed, 67 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 4d98b95..c452527 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -442,6 +442,8 @@ struct i40e_veb {\n \tbool stat_offsets_loaded;\n \tstruct i40e_eth_stats stats;\n \tstruct i40e_eth_stats stats_offsets;\n+\tstruct i40e_veb_tc_stats tc_stats;\n+\tstruct i40e_veb_tc_stats tc_stats_offsets;\n };\n \n /* struct that defines a VSI, associated with a dev */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 230d127..74c16a1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -197,7 +197,14 @@ static const struct i40e_stats i40e_gstrings_fcoe_stats[] = {\n \t\t FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_tx) + \\\n \t\t FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_2_xoff)) \\\n \t\t / sizeof(u64))\n+#define I40E_VEB_TC_STATS_LEN ( \\\n+\t\t(FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_packets) + \\\n+\t\t FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_bytes) + \\\n+\t\t FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_packets) + \\\n+\t\t FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_bytes)) \\\n+\t\t / sizeof(u64))\n #define I40E_VEB_STATS_LEN\tARRAY_SIZE(i40e_gstrings_veb_stats)\n+#define I40E_VEB_STATS_TOTAL\t(I40E_VEB_STATS_LEN + I40E_VEB_TC_STATS_LEN)\n #define I40E_PF_STATS_LEN(n)\t(I40E_GLOBAL_STATS_LEN + \\\n \t\t\t\t I40E_PFC_STATS_LEN + \\\n \t\t\t\t I40E_VSI_STATS_LEN((n)))\n@@ -1257,7 +1264,7 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)\n \t\t\tint len = I40E_PF_STATS_LEN(netdev);\n \n \t\t\tif (pf->lan_veb != I40E_NO_VEB)\n-\t\t\t\tlen += I40E_VEB_STATS_LEN;\n+\t\t\t\tlen += I40E_VEB_STATS_TOTAL;\n \t\t\treturn len;\n \t\t} else {\n \t\t\treturn I40E_VSI_STATS_LEN(netdev);\n@@ -1408,6 +1415,20 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,\n \t\t\t\t\ti40e_gstrings_veb_stats[i].stat_string);\n \t\t\t\tp += ETH_GSTRING_LEN;\n \t\t\t}\n+\t\t\tfor (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {\n+\t\t\t\tsnprintf(p, ETH_GSTRING_LEN,\n+\t\t\t\t\t \"veb.tc_%u_tx_packets\", i);\n+\t\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\t\tsnprintf(p, ETH_GSTRING_LEN,\n+\t\t\t\t\t \"veb.tc_%u_tx_bytes\", i);\n+\t\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\t\tsnprintf(p, ETH_GSTRING_LEN,\n+\t\t\t\t\t \"veb.tc_%u_rx_packets\", i);\n+\t\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\t\tsnprintf(p, ETH_GSTRING_LEN,\n+\t\t\t\t\t \"veb.tc_%u_rx_bytes\", i);\n+\t\t\t\tp += ETH_GSTRING_LEN;\n+\t\t\t}\n \t\t}\n \t\tfor (i = 0; i < I40E_GLOBAL_STATS_LEN; i++) {\n \t\t\tsnprintf(p, ETH_GSTRING_LEN, \"port.%s\",\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex d7a8276..4951b03 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -554,11 +554,15 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)\n \tstruct i40e_hw *hw = &pf->hw;\n \tstruct i40e_eth_stats *oes;\n \tstruct i40e_eth_stats *es; /* device's eth stats */\n-\tint idx = 0;\n+\tstruct i40e_veb_tc_stats *veb_oes;\n+\tstruct i40e_veb_tc_stats *veb_es;\n+\tint i, idx = 0;\n \n \tidx = veb->stats_idx;\n \tes = &veb->stats;\n \toes = &veb->stats_offsets;\n+\tveb_es = &veb->tc_stats;\n+\tveb_oes = &veb->tc_stats_offsets;\n \n \t/* Gather up the stats that the hw collects */\n \ti40e_stat_update32(hw, I40E_GLSW_TDPC(idx),\n@@ -594,6 +598,28 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)\n \ti40e_stat_update48(hw, I40E_GLSW_BPTCH(idx), I40E_GLSW_BPTCL(idx),\n \t\t\t veb->stat_offsets_loaded,\n \t\t\t &oes->tx_broadcast, &es->tx_broadcast);\n+\tfor (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {\n+\t\ti40e_stat_update48(hw, I40E_GLVEBTC_RPCH(i, idx),\n+\t\t\t\t I40E_GLVEBTC_RPCL(i, idx),\n+\t\t\t\t veb->stat_offsets_loaded,\n+\t\t\t\t &veb_oes->tc_rx_packets[i],\n+\t\t\t\t &veb_es->tc_rx_packets[i]);\n+\t\ti40e_stat_update48(hw, I40E_GLVEBTC_RBCH(i, idx),\n+\t\t\t\t I40E_GLVEBTC_RBCL(i, idx),\n+\t\t\t\t veb->stat_offsets_loaded,\n+\t\t\t\t &veb_oes->tc_rx_bytes[i],\n+\t\t\t\t &veb_es->tc_rx_bytes[i]);\n+\t\ti40e_stat_update48(hw, I40E_GLVEBTC_TPCH(i, idx),\n+\t\t\t\t I40E_GLVEBTC_TPCL(i, idx),\n+\t\t\t\t veb->stat_offsets_loaded,\n+\t\t\t\t &veb_oes->tc_tx_packets[i],\n+\t\t\t\t &veb_es->tc_tx_packets[i]);\n+\t\ti40e_stat_update48(hw, I40E_GLVEBTC_TBCH(i, idx),\n+\t\t\t\t I40E_GLVEBTC_TBCL(i, idx),\n+\t\t\t\t veb->stat_offsets_loaded,\n+\t\t\t\t &veb_oes->tc_tx_bytes[i],\n+\t\t\t\t &veb_es->tc_tx_bytes[i]);\n+\t}\n \tveb->stat_offsets_loaded = true;\n }\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 61b6b11..acb2aad 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -1105,6 +1105,14 @@ struct i40e_eth_stats {\n \tu64 tx_errors;\t\t\t/* tepc */\n };\n \n+/* Statistics collected per VEB per TC */\n+struct i40e_veb_tc_stats {\n+\tu64 tc_rx_packets[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_rx_bytes[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_tx_packets[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS];\n+};\n+\n #ifdef I40E_FCOE\n /* Statistics collected per function for FCoE */\n struct i40e_fcoe_stats {\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h\nindex e32dc0b..1ab2498 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h\n@@ -1095,6 +1095,14 @@ struct i40e_eth_stats {\n \tu64 tx_errors;\t\t\t/* tepc */\n };\n \n+/* Statistics collected per VEB per TC */\n+struct i40e_veb_tc_stats {\n+\tu64 tc_rx_packets[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_rx_bytes[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_tx_packets[I40E_MAX_TRAFFIC_CLASS];\n+\tu64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS];\n+};\n+\n /* Statistics collected by the MAC */\n struct i40e_hw_port_stats {\n \t/* eth stats collected by the port */\n", "prefixes": [ "next", "S8", "07/15" ] }