From: Shahed Shaikh <shahed.shaikh@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Dept_NX_Linux_NIC_Driver@qlogic.com,
Shahed Shaikh <shahed.shaikh@qlogic.com>
Subject: [PATCH net-next 4/5] qlcnic: Fix ethtool statistics collection
Date: Fri, 8 Mar 2013 14:53:52 -0500 [thread overview]
Message-ID: <1362772433-12045-5-git-send-email-shahed.shaikh@qlogic.com> (raw)
In-Reply-To: <1362772433-12045-1-git-send-email-shahed.shaikh@qlogic.com>
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
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>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 8 ++++----
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 f687a63..f4f279d 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)
}
}
-static void
-qlcnic_fill_stats(u64 *data, void *stats, int type)
+static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
{
if (type == QLCNIC_MAC_STATS) {
struct qlcnic_mac_statistics *mac_stats =
@@ -1121,6 +1120,7 @@ qlcnic_fill_stats(u64 *data, void *stats, int type)
*data++ = QLCNIC_FILL_STATS(esw_stats->local_frames);
*data++ = QLCNIC_FILL_STATS(esw_stats->numbytes);
}
+ return data;
}
static void qlcnic_get_ethtool_stats(struct net_device *dev,
@@ -1148,7 +1148,7 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev,
/* Retrieve MAC statistics from firmware */
memset(&mac_stats, 0, sizeof(struct qlcnic_mac_statistics));
qlcnic_get_mac_stats(adapter, &mac_stats);
- qlcnic_fill_stats(data, &mac_stats, QLCNIC_MAC_STATS);
+ data = qlcnic_fill_stats(data, &mac_stats, QLCNIC_MAC_STATS);
}
if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
@@ -1160,7 +1160,7 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev,
if (ret)
return;
- qlcnic_fill_stats(data, &port_stats.rx, QLCNIC_ESW_STATS);
+ data = qlcnic_fill_stats(data, &port_stats.rx, QLCNIC_ESW_STATS);
ret = qlcnic_get_port_stats(adapter, adapter->ahw->pci_func,
QLCNIC_QUERY_TX_COUNTER, &port_stats.tx);
if (ret)
--
1.5.6
next prev parent reply other threads:[~2013-03-08 20:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 19:53 [PATCH net-next 0/5] qlcnic: bug fixes and feature updates Shahed Shaikh
2013-03-08 19:53 ` [PATCH net-next 1/1] qlcnic: Fix endian issues in 83xx driver Shahed Shaikh
2013-03-08 19:53 ` [PATCH net-next 2/5] qlcnic: Enable LED test support for 83xx adapter Shahed Shaikh
2013-03-08 19:53 ` [PATCH net-next 3/5] qlcnic: Fix ethtool statistics for 82xx adapter Shahed Shaikh
2013-03-08 19:53 ` Shahed Shaikh [this message]
2013-03-08 19:53 ` [PATCH net-next 5/5] qlcnic: Bump up the version to 5.1.36 Shahed Shaikh
2013-03-09 21:10 ` [PATCH net-next 0/5] qlcnic: bug fixes and feature updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362772433-12045-5-git-send-email-shahed.shaikh@qlogic.com \
--to=shahed.shaikh@qlogic.com \
--cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).