diff mbox

[v2] igb: Record host memory receive overflow in net_stats

Message ID 1241600198.5172.36.camel@localhost.localdomain
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Dangaard Brouer May 6, 2009, 8:56 a.m. UTC
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

I have shown that this situation can arise when the kernel is too
busy else where.

As the the RNBC value is not necessary a packet drop, I choose to
store the RNBC value in net_stats.rx_fifo_errors.

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: Jesper Dangaard Brouer <hawk@comx.dk>
---

 drivers/net/igb/igb_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 183235d..3ee00a5 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3597,6 +3597,10 @@  void igb_update_stats(struct igb_adapter *adapter)
 	adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
 	adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
 
+	/* Note RNBC (Receive No Buffers Count) is an overflow
+	 * indication, thus not necessary a dropped packet. */
+	adapter->net_stats.rx_fifo_errors = adapter->stats.rnbc;
+
 	/* Tx Errors */
 	adapter->net_stats.tx_errors = adapter->stats.ecol +
 				       adapter->stats.latecol;