public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@comx.dk>
To: "David S. Miller" <davem@davemloft.net>
Cc: Robert Olsson <Robert.Olsson@data.slu.se>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	hawk@comx.dk
Subject: [PATCH 2/3] NIU: Implement discard counters, info/debug statements.
Date: Thu, 18 Dec 2008 14:56:18 +0100	[thread overview]
Message-ID: <1229608578.16904.28.camel@localhost.localdomain> (raw)
In-Reply-To: <1229608331.16904.23.camel@localhost.localdomain>


Discard packet counter debug statements that can be turned on
runtime, by users to assist debugging of the driver code.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---

 drivers/net/niu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 1bd7018..9f6a98f 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3560,6 +3560,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
 		if (unlikely(misc & RXMISC_OFLOW))
 			dev_err(np->device, "rx-%d: Counter overflow "
 				"RXMISC discard\n", rx_channel);
+
+		niudbg(RX_ERR, "%s-rx-%d: MISC drop=%u over=%u\n",
+		       np->dev->name, rx_channel, misc, misc-limit);
 	}
 
 	/* WRED (Weighted Random Early Discard) by hardware */
@@ -3571,6 +3574,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
 		if (unlikely(wred & RED_DIS_CNT_OFLOW))
 			dev_err(np->device, "rx-%d: Counter overflow "
 				"WRED discard\n", rx_channel);
+
+		niudbg(RX_ERR, "%s-rx-%d: WRED drop=%u over=%u\n",
+		       np->dev->name, rx_channel, wred, wred-limit);
 	}
 }
 



  parent reply	other threads:[~2008-12-18 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18 13:52 [PATCH 0/3] NIU: Implement discard counters Jesper Dangaard Brouer
2008-12-18 13:54 ` [PATCH 1/3] " Jesper Dangaard Brouer
2008-12-18 13:56 ` Jesper Dangaard Brouer [this message]
2008-12-18 13:58 ` [PATCH 3/3] NIU: Implement discard counters, optimize Jesper Dangaard Brouer
2008-12-19  3:48 ` [PATCH 0/3] NIU: Implement discard 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=1229608578.16904.28.camel@localhost.localdomain \
    --to=hawk@comx.dk \
    --cc=Robert.Olsson@data.slu.se \
    --cc=davem@davemloft.net \
    --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