netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 3/6] sky2: keep track of receive alloc failures
Date: Mon, 14 May 2007 12:38:12 -0700	[thread overview]
Message-ID: <20070514193945.686777738@linux-foundation.org> (raw)
In-Reply-To: 20070514193809.867470364@linux-foundation.org

[-- Attachment #1: sky2-rx_dropped --]
[-- Type: text/plain, Size: 792 bytes --]

When driver can't allocate receive buffer it drops incoming
packet. Keep a counter.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/sky2.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- 2.6.21-rc1.orig/drivers/net/sky2.c	2007-05-14 12:10:13.000000000 -0700
+++ 2.6.21-rc1/drivers/net/sky2.c	2007-05-14 12:10:16.000000000 -0700
@@ -2141,8 +2141,10 @@ static int sky2_status_intr(struct sky2_
 		switch (le->opcode & ~HW_OWNER) {
 		case OP_RXSTAT:
 			skb = sky2_receive(dev, length, status);
-			if (!skb)
+			if (unlikely(!skb)) {
+				sky2->net_stats.rx_dropped++;
 				goto force_update;
+			}
 
 			skb->protocol = eth_type_trans(skb, dev);
 			sky2->net_stats.rx_packets++;

--
Stephen Hemminger <shemminger@linux-foundation.org>


  parent reply	other threads:[~2007-05-14 19:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14 19:38 [PATCH 0/6] more sky2 patches for 2.6.22 Stephen Hemminger
2007-05-14 19:38 ` [PATCH 1/6] sky2: remove Gigabyte 88e8056 restriction Stephen Hemminger
2007-05-18  0:44   ` Jeff Garzik
2007-05-14 19:38 ` [PATCH 2/6] sky2: PHY register settings Stephen Hemminger
2007-05-14 19:38 ` Stephen Hemminger [this message]
2007-05-14 19:38 ` [PATCH 4/6] sky2: MIB counter overflow handling Stephen Hemminger
2007-05-14 19:38 ` [PATCH 5/6] sky2: remove dual port workaround Stephen Hemminger
2007-05-14 19:38 ` [PATCH 6/6] sky2: memory barriers change Stephen Hemminger

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=20070514193945.686777738@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /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).