From patchwork Thu Dec 18 13:56:18 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 14671 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 0E09DDDF25 for ; Fri, 19 Dec 2008 00:56:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751553AbYLRN4U (ORCPT ); Thu, 18 Dec 2008 08:56:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751540AbYLRN4U (ORCPT ); Thu, 18 Dec 2008 08:56:20 -0500 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:32841 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbYLRN4T (ORCPT ); Thu, 18 Dec 2008 08:56:19 -0500 Received: from comxexch02.comx.local (unknown [172.31.1.117]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id C5311163A31; Thu, 18 Dec 2008 14:56:18 +0100 (CET) Received: from hawk.comx.local ([172.31.4.93]) by comxexch02.comx.local with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Dec 2008 14:56:18 +0100 Subject: [PATCH 2/3] NIU: Implement discard counters, info/debug statements. From: Jesper Dangaard Brouer To: "David S. Miller" Cc: Robert Olsson , "netdev@vger.kernel.org" , hawk@comx.dk In-Reply-To: <1229608331.16904.23.camel@localhost.localdomain> References: <1229608331.16904.23.camel@localhost.localdomain> Organization: ComX Networks A/S Date: Thu, 18 Dec 2008 14:56:18 +0100 Message-Id: <1229608578.16904.28.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-OriginalArrivalTime: 18 Dec 2008 13:56:18.0547 (UTC) FILETIME=[669D6430:01C96118] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/niu.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 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 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); } }