All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brice Goglin <brice@myri.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next] myri10ge: fix per-slice rx/tx_dropped counters
Date: Tue, 18 Nov 2008 21:10:56 +0100	[thread overview]
Message-ID: <49232150.4010202@myri.com> (raw)

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

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



             reply	other threads:[~2008-11-18 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18 20:10 Brice Goglin [this message]
2008-11-20  9:50 ` [PATCH net-next] myri10ge: fix per-slice rx/tx_dropped counters David Miller

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=49232150.4010202@myri.com \
    --to=brice@myri.com \
    --cc=jeff@garzik.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.