netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <netanel@amazon.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: Netanel Belgazal <netanel@amazon.com>, <dwmw@amazon.com>,
	<zorik@amazon.com>, <matua@amazon.com>, <saeedb@amazon.com>,
	<msw@amazon.com>, <aliguori@amazon.com>, <nafea@amazon.com>,
	<evgenys@amazon.com>
Subject: [PATCH V2 net-next 10/11] net: ena: update driver's rx drop statistics
Date: Fri, 23 Jun 2017 11:21:59 +0300	[thread overview]
Message-ID: <1498206120-13805-11-git-send-email-netanel@amazon.com> (raw)
In-Reply-To: <1498206120-13805-1-git-send-email-netanel@amazon.com>

From: Netanel Belgazal <netanel@amazon.com>

rx drop counter is reported by the device in the keep-alive
event.
update the driver's counter with the device counter.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 7dee448157bb..f7dc22f65d9f 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -3478,8 +3478,17 @@ static void ena_keep_alive_wd(void *adapter_data,
 			      struct ena_admin_aenq_entry *aenq_e)
 {
 	struct ena_adapter *adapter = (struct ena_adapter *)adapter_data;
+	struct ena_admin_aenq_keep_alive_desc *desc;
+	u64 rx_drops;
 
+	desc = (struct ena_admin_aenq_keep_alive_desc *)aenq_e;
 	adapter->last_keep_alive_jiffies = jiffies;
+
+	rx_drops = ((u64)desc->rx_drops_high << 32) | desc->rx_drops_low;
+
+	u64_stats_update_begin(&adapter->syncp);
+	adapter->dev_stats.rx_drops = rx_drops;
+	u64_stats_update_end(&adapter->syncp);
 }
 
 static void ena_notification(void *adapter_data,
-- 
2.7.4

  parent reply	other threads:[~2017-06-23  8:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23  8:21 [PATCH V2 net-next 00/11] update ena ethernet driver to version 1.2.0 netanel
2017-06-23  8:21 ` [PATCH V2 net-next 01/11] net: ena: change return value for unsupported features unsupported return value netanel
2017-06-23  8:21 ` [PATCH V2 net-next 02/11] net: ena: add hardware hints capability to the driver netanel
2017-06-23  8:21 ` [PATCH V2 net-next 03/11] net: ena: change sizeof() argument to be the type pointer netanel
2017-06-23  8:21 ` [PATCH V2 net-next 04/11] net: ena: add reset reason for each device FLR netanel
2017-06-23  8:21 ` [PATCH V2 net-next 05/11] net: ena: add support for out of order rx buffers refill netanel
2017-06-23  8:21 ` [PATCH V2 net-next 06/11] net: ena: allow the driver to work with small number of msix vectors netanel
2017-06-23  8:21 ` [PATCH V2 net-next 07/11] net: ena: use napi_schedule_irqoff when possible netanel
2017-06-23  8:21 ` [PATCH V2 net-next 08/11] net: ena: separate skb allocation to dedicated function netanel
2017-06-23  8:21 ` [PATCH V2 net-next 09/11] net: ena: use lower_32_bits()/upper_32_bits() to split dma address netanel
2017-06-23  8:21 ` netanel [this message]
2017-06-23  8:22 ` [PATCH V2 net-next 11/11] net: ena: update ena driver to version 1.2.0 netanel
2017-06-23 18:16 ` [PATCH V2 net-next 00/11] update ena ethernet " 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=1498206120-13805-11-git-send-email-netanel@amazon.com \
    --to=netanel@amazon.com \
    --cc=aliguori@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dwmw@amazon.com \
    --cc=evgenys@amazon.com \
    --cc=matua@amazon.com \
    --cc=msw@amazon.com \
    --cc=nafea@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedb@amazon.com \
    --cc=zorik@amazon.com \
    /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).