From: Jesper Dangaard Brouer <hawk@comx.dk>
To: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"e1000-devel@lists.sourceforge.net"
<e1000-devel@lists.sourceforge.net>,
"Ronciak, John" <john.ronciak@intel.com>,
"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Subject: [PATCH 2/2] igb: Record host memory receive overflow in net_stats
Date: Thu, 07 May 2009 15:38:32 +0200 [thread overview]
Message-ID: <1241703512.18487.27.camel@localhost.localdomain> (raw)
In-Reply-To: <1241703346.18487.22.camel@localhost.localdomain>
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.
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, as its potentically
not a true drop.
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 | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 06b01fc..539b9f8 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3496,6 +3496,7 @@ void igb_update_stats(struct igb_adapter *adapter)
struct pci_dev *pdev = adapter->pdev;
u16 phy_tmp;
u32 rqdpc_tmp;
+ u64 rqdpc_total = 0;
int i;
#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
@@ -3598,7 +3599,15 @@ void igb_update_stats(struct igb_adapter *adapter)
for (i = 0; i < adapter->num_rx_queues; i++) {
rqdpc_tmp = rd32(E1000_RQDPC(i)) & 0xFFF;
adapter->rx_ring[i].rx_stats.drops += rqdpc_tmp;
+ rqdpc_total += adapter->rx_ring[i].rx_stats.drops;
}
+ adapter->net_stats.rx_fifo_errors = rqdpc_total;
+
+ /* Note RNBC (Receive No Buffers Count) is an not an exact
+ * drop count as the hardware FIFO might save the day. Thats
+ * one of the reason for saving it in rx_fifo_errors, as its
+ * potentically not a true drop. */
+ adapter->net_stats.rx_fifo_errors += adapter->stats.rnbc;
/* RLEC on some newer hardware can be incorrect so build
* our own version based on RUC and ROC */
next prev parent reply other threads:[~2009-05-07 13:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 13:35 [PATCH 0/2] igb: drop stats due to OS cannot keep up Jesper Dangaard Brouer
2009-05-07 13:37 ` [PATCH 1/2] igb: Implement reading of reg RQDPC (Receive Queue Drop Packet Count) Jesper Dangaard Brouer
2009-05-07 16:06 ` Williams, Mitch A
2009-05-07 19:19 ` Jesper Dangaard Brouer
2009-05-07 19:24 ` Stephen Hemminger
2009-05-11 9:50 ` Jesper Dangaard Brouer
2009-05-13 21:07 ` Williams, Mitch A
2009-05-14 8:03 ` Jesper Dangaard Brouer
2009-05-07 13:38 ` Jesper Dangaard Brouer [this message]
2009-05-14 22:43 ` [PATCH 0/2] igb: drop stats due to OS cannot keep up Jeff Kirsher
2009-05-15 7:41 ` Jesper Dangaard Brouer
2009-05-18 7:16 ` Jeff Kirsher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1241703512.18487.27.camel@localhost.localdomain \
--to=hawk@comx.dk \
--cc=davem@davemloft.net \
--cc=e1000-devel@lists.sourceforge.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=john.ronciak@intel.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).