aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <hawk@comx.dk>2009-05-26 09:50:31 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-26 23:35:05 -0400
commit8c0ab70ab9cc849af59ef6592bd652a938b21c79 (patch)
treef7be759f12ba98ea679ba8c7b161f17eaba7fdeb /drivers/net/igb/igb_main.c
parent3c514ce2f9ae20c06fb17c7ccff40cad1516cc41 (diff)
igb: Implement reading of reg RQDPC (Receive Queue Drop Packet Count)
Based on the previous patches from Jesper Dangaard Brouer <hawk@comx.dk> Implement reading the per queue drop stats register RQDPC (Receive Queue Drop Packet Count). It counts the number of packets dropped by a queue due to lack of descriptors available. Notice RQDPC (Receive Queue Drop Packet Count) stats only gets incremented, if the DROP_EN bit it set (in the SRRCTL register for that queue). If DROP_EN bit is NOT set, then the some what equivalent count is stored in RNBC (not per queue basis). The RQDPC register is only 12 bit, thus the precision might suffer due to overrun in-netween the watchdog polling interval. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> CC: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r--drivers/net/igb/igb_main.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 2ec98091948..4ae81331dca 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3588,8 +3588,25 @@ void igb_update_stats(struct igb_adapter *adapter)
3588 3588
3589 /* Rx Errors */ 3589 /* Rx Errors */
3590 3590
3591 if (hw->mac.type != e1000_82575) {
3592 u32 rqdpc_tmp;
3593 int i;
3594 /* Read out drops stats per RX queue. Notice RQDPC (Receive
3595 * Queue Drop Packet Count) stats only gets incremented, if
3596 * the DROP_EN but it set (in the SRRCTL register for that
3597 * queue). If DROP_EN bit is NOT set, then the some what
3598 * equivalent count is stored in RNBC (not per queue basis).
3599 * Also note the drop count is due to lack of available
3600 * descriptors.
3601 */
3602 for (i = 0; i < adapter->num_rx_queues; i++) {
3603 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0xFFF;
3604 adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
3605 }
3606 }
3607
3591 /* RLEC on some newer hardware can be incorrect so build 3608 /* RLEC on some newer hardware can be incorrect so build
3592 * our own version based on RUC and ROC */ 3609 * our own version based on RUC and ROC */
3593 adapter->net_stats.rx_errors = adapter->stats.rxerrc + 3610 adapter->net_stats.rx_errors = adapter->stats.rxerrc +
3594 adapter->stats.crcerrs + adapter->stats.algnerrc + 3611 adapter->stats.crcerrs + adapter->stats.algnerrc +
3595 adapter->stats.ruc + adapter->stats.roc + 3612 adapter->stats.ruc + adapter->stats.roc +