aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShahed Shaikh <shahed.shaikh@qlogic.com>2013-03-08 04:53:52 -0500
committerDavid S. Miller <davem@davemloft.net>2013-03-09 16:09:19 -0500
commit9434dbfe54518ca65fc80a4c8d3ee581fa6ee8be (patch)
treea45f7ad601e7cb60e17db9e14cf52f90b10db831
parent1075822c871b56eb1e77cff82fae7bc9d7876d0a (diff)
qlcnic: Fix ethtool statistics collection
o Properly fill statistics data into buffer. Update buffer pointer properly after filling statistics data into buffer. Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index f687a6354e4a..f4f279d5cba4 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -1071,8 +1071,7 @@ qlcnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
1071 } 1071 }
1072} 1072}
1073 1073
1074static void 1074static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
1075qlcnic_fill_stats(u64 *data, void *stats, int type)
1076{ 1075{
1077 if (type == QLCNIC_MAC_STATS) { 1076 if (type == QLCNIC_MAC_STATS) {
1078 struct qlcnic_mac_statistics *mac_stats = 1077 struct qlcnic_mac_statistics *mac_stats =
@@ -1121,6 +1120,7 @@ qlcnic_fill_stats(u64 *data, void *stats, int type)
1121 *data++ = QLCNIC_FILL_STATS(esw_stats->local_frames); 1120 *data++ = QLCNIC_FILL_STATS(esw_stats->local_frames);
1122 *data++ = QLCNIC_FILL_STATS(esw_stats->numbytes); 1121 *data++ = QLCNIC_FILL_STATS(esw_stats->numbytes);
1123 } 1122 }
1123 return data;
1124} 1124}
1125 1125
1126static void qlcnic_get_ethtool_stats(struct net_device *dev, 1126static void qlcnic_get_ethtool_stats(struct net_device *dev,
@@ -1148,7 +1148,7 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev,
1148 /* Retrieve MAC statistics from firmware */ 1148 /* Retrieve MAC statistics from firmware */
1149 memset(&mac_stats, 0, sizeof(struct qlcnic_mac_statistics)); 1149 memset(&mac_stats, 0, sizeof(struct qlcnic_mac_statistics));
1150 qlcnic_get_mac_stats(adapter, &mac_stats); 1150 qlcnic_get_mac_stats(adapter, &mac_stats);
1151 qlcnic_fill_stats(data, &mac_stats, QLCNIC_MAC_STATS); 1151 data = qlcnic_fill_stats(data, &mac_stats, QLCNIC_MAC_STATS);
1152 } 1152 }
1153 1153
1154 if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED)) 1154 if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
@@ -1160,7 +1160,7 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev,
1160 if (ret) 1160 if (ret)
1161 return; 1161 return;
1162 1162
1163 qlcnic_fill_stats(data, &port_stats.rx, QLCNIC_ESW_STATS); 1163 data = qlcnic_fill_stats(data, &port_stats.rx, QLCNIC_ESW_STATS);
1164 ret = qlcnic_get_port_stats(adapter, adapter->ahw->pci_func, 1164 ret = qlcnic_get_port_stats(adapter, adapter->ahw->pci_func,
1165 QLCNIC_QUERY_TX_COUNTER, &port_stats.tx); 1165 QLCNIC_QUERY_TX_COUNTER, &port_stats.tx);
1166 if (ret) 1166 if (ret)