@@ -633,6 +633,7 @@ static const struct nv_ethtool_str nv_estats_str[] = {
{ "rx_packets" },
{ "rx_errors_total" },
{ "tx_errors_total" },
+ { "tx_timeout" },
/* version 2 stats */
{ "tx_deferral" },
@@ -673,6 +674,7 @@ struct nv_ethtool_stats {
u64 rx_packets;
u64 rx_errors_total;
u64 tx_errors_total;
+ u64 tx_timeout;
/* version 2 stats */
u64 tx_deferral;
@@ -842,6 +844,7 @@ struct fe_priv {
struct nv_skb_map *tx_end_flip;
int tx_stop;
struct nv_driver_stat stat_tx_dropped;
+ atomic_t stat_tx_timeout; /* TX timeouts since last nv_update_stats */
/* msi/msi-x fields */
u32 msi_flags;
@@ -1728,6 +1731,7 @@ static void nv_update_stats(struct net_device *dev)
}
/* update software stats */
+ np->estats.tx_timeout += atomic_xchg(&np->stat_tx_timeout, 0);
NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_rx_dropped);
NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_tx_dropped);
NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_rx_missed_errors);
@@ -2590,6 +2594,8 @@ static void nv_tx_timeout(struct net_device *dev)
}
}
+ atomic_inc(&np->stat_tx_timeout);
+
spin_lock_irq(&np->lock);
/* 1) stop tx engine */