net: ena: update driver's rx drop statistics
authorNetanel Belgazal <netanel@amazon.com>
Fri, 23 Jun 2017 08:21:59 +0000 (11:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jun 2017 18:15:11 +0000 (14:15 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_netdev.c

index 7dee448157bbb2bf7f1fae94b02f0de2ee7ece6e..f7dc22f65d9f64ac50cd641d30e4d83f88fe5bba 100644 (file)
@@ -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,