All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Russkikh <Igor.Russkikh@aquantia.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Nikita Danilov <Nikita.Danilov@aquantia.com>,
	Dmitry Bogdanov <Dmitry.Bogdanov@aquantia.com>,
	Igor Russkikh <Igor.Russkikh@aquantia.com>
Subject: [PATCH v4 net-next 12/15] net: aquantia: fetch up to date statistics on ethtool request
Date: Mon, 29 Apr 2019 10:05:02 +0000	[thread overview]
Message-ID: <9b824b0e582e7670a1226f16df70c76acbf86b8c.1556531633.git.igor.russkikh@aquantia.com> (raw)
In-Reply-To: <cover.1556531633.git.igor.russkikh@aquantia.com>

From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>

This improves ethtool -S usage, where stats are now actual
on each request. Before that stats only were updated at service
timer period.

Tested-by: Nikita Danilov <ndanilov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 454a44bb148e..8018f483ae45 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -700,7 +700,14 @@ void aq_nic_get_stats(struct aq_nic_s *self, u64 *data)
 	unsigned int i = 0U;
 	unsigned int count = 0U;
 	struct aq_vec_s *aq_vec = NULL;
-	struct aq_stats_s *stats = self->aq_hw_ops->hw_get_hw_stats(self->aq_hw);
+	struct aq_stats_s *stats;
+
+	if (self->aq_fw_ops->update_stats) {
+		mutex_lock(&self->fwreq_mutex);
+		self->aq_fw_ops->update_stats(self->aq_hw);
+		mutex_unlock(&self->fwreq_mutex);
+	}
+	stats = self->aq_hw_ops->hw_get_hw_stats(self->aq_hw);
 
 	if (!stats)
 		goto err_exit;
-- 
2.17.1


  parent reply	other threads:[~2019-04-29 10:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 10:04 [PATCH v4 net-next 00/15] net: atlantic: Aquantia driver updates 2019-04 Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 01/15] net: aquantia: add infrastructure to readout chip temperature Igor Russkikh
2019-04-29 22:13   ` Andrew Lunn
2019-04-29 10:04 ` [PATCH v4 net-next 02/15] net: aquantia: implement hwmon api for " Igor Russkikh
2019-04-29 22:14   ` Andrew Lunn
2019-04-29 10:04 ` [PATCH v4 net-next 03/15] net: aquantia: add link interrupt fields Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 04/15] net: aquantia: link interrupt handling function Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 05/15] net: aquantia: create global service workqueue Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 06/15] net: aquantia: link status irq handling Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 07/15] net: aquantia: improve ifup link detection Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 08/15] net: aquantia: use macros for better visibility Igor Russkikh
2019-04-29 22:16   ` Andrew Lunn
2019-04-30  8:05     ` Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 09/15] net: aquantia: user correct MSI irq type Igor Russkikh
2019-04-29 10:04 ` [PATCH v4 net-next 10/15] net: aquantia: introduce fwreq mutex Igor Russkikh
2019-04-29 10:05 ` [PATCH v4 net-next 11/15] net: aquantia: extract timer cb into work job Igor Russkikh
2019-04-29 10:05 ` Igor Russkikh [this message]
2019-04-29 10:05 ` [PATCH v4 net-next 13/15] net: aquantia: get total counters from DMA block Igor Russkikh
2019-04-29 10:05 ` [PATCH v4 net-next 14/15] net: aquantia: fixups on 64bit dma counters Igor Russkikh
2019-04-29 10:05 ` [PATCH v4 net-next 15/15] net: aquantia: remove outdated device ids Igor Russkikh
2019-05-01 13:30 ` [PATCH v4 net-next 00/15] net: atlantic: Aquantia driver updates 2019-04 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=9b824b0e582e7670a1226f16df70c76acbf86b8c.1556531633.git.igor.russkikh@aquantia.com \
    --to=igor.russkikh@aquantia.com \
    --cc=Dmitry.Bogdanov@aquantia.com \
    --cc=Nikita.Danilov@aquantia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.