aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <hawk@comx.dk>2009-05-26 09:50:48 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-26 23:35:06 -0400
commit3ea73afafb8cd237a823ec5d0a0a2f2396b03b33 (patch)
tree591865ec06a265346b9ed9c2750701f9f570bd2c /drivers/net/igb
parent8c0ab70ab9cc849af59ef6592bd652a938b21c79 (diff)
igb: Record host memory receive overflow in net_stats
Based on previous patch from Jesper Dangaard Brouer. The RNBC (Receive No Buffers Count) register for the 82576, indicate that frames were received when there were no available buffers in host memory to store those frames (receive descriptor head and tail pointers were equal). The packet is still received by the NIC if there is space in the FIFO on the NIC. As the RNBC value is not a packet drop, the driver stores this value in net_stats.rx_fifo_errors to indicate that there were no system buffers available for the incoming packet. Actual dropped packets are counted in the MPC value. Saving the stats in dev->net_stats makes it visible via /proc/net/dev as "fifo", and thus viewable to ifconfig as "overruns" and 'netstat -i' as "RX-OVR". The Receive No Buffers Count (RNBC) can already be queried by ethtool -S as "rx_no_buffer_count". 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')
-rw-r--r--drivers/net/igb/igb_ethtool.c1
-rw-r--r--drivers/net/igb/igb_main.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 2ae98f91372e..9598ac09f4b8 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -64,6 +64,7 @@ static const struct igb_stats igb_gstrings_stats[] = {
64 { "rx_crc_errors", IGB_STAT(stats.crcerrs) }, 64 { "rx_crc_errors", IGB_STAT(stats.crcerrs) },
65 { "rx_frame_errors", IGB_STAT(net_stats.rx_frame_errors) }, 65 { "rx_frame_errors", IGB_STAT(net_stats.rx_frame_errors) },
66 { "rx_no_buffer_count", IGB_STAT(stats.rnbc) }, 66 { "rx_no_buffer_count", IGB_STAT(stats.rnbc) },
67 { "rx_queue_drop_packet_count", IGB_STAT(net_stats.rx_fifo_errors) },
67 { "rx_missed_errors", IGB_STAT(stats.mpc) }, 68 { "rx_missed_errors", IGB_STAT(stats.mpc) },
68 { "tx_aborted_errors", IGB_STAT(stats.ecol) }, 69 { "tx_aborted_errors", IGB_STAT(stats.ecol) },
69 { "tx_carrier_errors", IGB_STAT(stats.tncrs) }, 70 { "tx_carrier_errors", IGB_STAT(stats.tncrs) },
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 4ae81331dca5..8e93750d5120 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3590,6 +3590,7 @@ void igb_update_stats(struct igb_adapter *adapter)
3590 3590
3591 if (hw->mac.type != e1000_82575) { 3591 if (hw->mac.type != e1000_82575) {
3592 u32 rqdpc_tmp; 3592 u32 rqdpc_tmp;
3593 u64 rqdpc_total = 0;
3593 int i; 3594 int i;
3594 /* Read out drops stats per RX queue. Notice RQDPC (Receive 3595 /* Read out drops stats per RX queue. Notice RQDPC (Receive
3595 * Queue Drop Packet Count) stats only gets incremented, if 3596 * Queue Drop Packet Count) stats only gets incremented, if
@@ -3602,9 +3603,18 @@ void igb_update_stats(struct igb_adapter *adapter)
3602 for (i = 0; i < adapter->num_rx_queues; i++) { 3603 for (i = 0; i < adapter->num_rx_queues; i++) {
3603 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0xFFF; 3604 rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0xFFF;
3604 adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp; 3605 adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
3606 rqdpc_total += adapter->rx_ring[i].rx_stats.drops;
3605 } 3607 }
3608 adapter->net_stats.rx_fifo_errors = rqdpc_total;
3606 } 3609 }
3607 3610
3611 /* Note RNBC (Receive No Buffers Count) is an not an exact
3612 * drop count as the hardware FIFO might save the day. Thats
3613 * one of the reason for saving it in rx_fifo_errors, as its
3614 * potentially not a true drop.
3615 */
3616 adapter->net_stats.rx_fifo_errors += adapter->stats.rnbc;
3617
3608 /* RLEC on some newer hardware can be incorrect so build 3618 /* RLEC on some newer hardware can be incorrect so build
3609 * our own version based on RUC and ROC */ 3619 * our own version based on RUC and ROC */
3610 adapter->net_stats.rx_errors = adapter->stats.rxerrc + 3620 adapter->net_stats.rx_errors = adapter->stats.rxerrc +