Patchwork sky2: Flow control frames recorded as dropped packets

login
register
mail settings
Submitter Stephen Hemminger
Date Feb. 3, 2010, 6:31 p.m.
Message ID <20100203103112.091b1b14@nehalam>
Download mbox | patch
Permalink /patch/44400/
State Accepted
Delegated to: David Miller
Headers show

Comments

Stephen Hemminger - Feb. 3, 2010, 6:31 p.m.
Thanks for your patch.  A more general solution would be to move the
rx_dropped up into sky2_receive.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--
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

Patch

--- a/drivers/net/sky2.c	2010-02-03 09:10:27.863367226 -0800
+++ b/drivers/net/sky2.c	2010-02-03 09:17:01.602741445 -0800
@@ -2404,6 +2404,9 @@  okay:
 		skb = receive_copy(sky2, re, length);
 	else
 		skb = receive_new(sky2, re, length);
+
+	dev->stats.rx_dropped += (skb == NULL);
+
 resubmit:
 	sky2_rx_submit(sky2, re);
 
@@ -2515,11 +2518,10 @@  static int sky2_status_intr(struct sky2_
 		case OP_RXSTAT:
 			total_packets[port]++;
 			total_bytes[port] += length;
+
 			skb = sky2_receive(dev, length, status);
-			if (unlikely(!skb)) {
-				dev->stats.rx_dropped++;
+			if (!skb)
 				break;
-			}
 
 			/* This chip reports checksum status differently */
 			if (hw->flags & SKY2_HW_NEW_LE) {