net/ena: refactor ena_get_stats64 to be atomic context safe
authorNetanel Belgazal <netanel@annapurnalabs.com>
Thu, 9 Feb 2017 13:21:32 +0000 (15:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2017 03:27:06 +0000 (22:27 -0500)
commitd81db24056132fe8b83e2fba337e9ea76675e68d
tree86c7227b467f50313292561b7412a2f8e608eb9d
parent22b331c9e0a345126708af60f7d00d38b53db70b
net/ena: refactor ena_get_stats64 to be atomic context safe

ndo_get_stat64() can be called from atomic context, but the current
implementation sends an admin command to retrieve the statistics from
the device. This admin command can sleep.

This patch re-factors the implementation of ena_get_stats64() to use
the {rx,tx}bytes/count from the driver's inner counters, and to obtain
the rx drop counter from the asynchronous keep alive (heart bit)
event.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_admin_defs.h
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amazon/ena/ena_netdev.h