diff mbox

[net-next] myri10ge: fix per-slice rx/tx_dropped counters

Message ID 49232150.4010202@myri.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Brice Goglin Nov. 18, 2008, 8:10 p.m. UTC
Properly attribute transmit and receive drops by incrementing the
per-slice counter.

Signed-off-by: Brice Goglin <brice@myri.com>
---
 drivers/net/myri10ge/myri10ge.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 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

Comments

David Miller Nov. 20, 2008, 9:50 a.m. UTC | #1
From: Brice Goglin <brice@myri.com>
Date: Tue, 18 Nov 2008 21:10:56 +0100

> Properly attribute transmit and receive drops by incrementing the
> per-slice counter.
> 
> Signed-off-by: Brice Goglin <brice@myri.com>

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

Index: net-next-2.6/drivers/net/myri10ge/myri10ge.c
===================================================================
--- net-next-2.6.orig/drivers/net/myri10ge/myri10ge.c	2008-11-11 21:51:11.000000000 +0100
+++ net-next-2.6/drivers/net/myri10ge/myri10ge.c	2008-11-18 21:02:12.000000000 +0100
@@ -1309,7 +1309,7 @@ 
 
 	skb = netdev_alloc_skb(dev, MYRI10GE_HLEN + 16);
 	if (unlikely(skb == NULL)) {
-		mgp->stats.rx_dropped++;
+		ss->stats.rx_dropped++;
 		do {
 			i--;
 			put_page(rx_frags[i].page);
@@ -2924,6 +2924,7 @@ 
 {
 	struct sk_buff *segs, *curr;
 	struct myri10ge_priv *mgp = netdev_priv(dev);
+	struct myri10ge_slice_state *ss;
 	int status;
 
 	segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6);
@@ -2950,8 +2951,9 @@ 
 	return 0;
 
 drop:
+	ss = &mgp->ss[skb_get_queue_mapping(skb)];
 	dev_kfree_skb_any(skb);
-	mgp->stats.tx_dropped += 1;
+	ss->stats.tx_dropped += 1;
 	return 0;
 }