From patchwork Thu Dec 18 13:58:26 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: 14672 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 53226DDF26 for ; Fri, 19 Dec 2008 00:58:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751395AbYLRN63 (ORCPT ); Thu, 18 Dec 2008 08:58:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751462AbYLRN63 (ORCPT ); Thu, 18 Dec 2008 08:58:29 -0500 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:32986 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbYLRN62 (ORCPT ); Thu, 18 Dec 2008 08:58:28 -0500 Received: from comxexch02.comx.local (unknown [172.31.1.117]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id 3C10E163A31; Thu, 18 Dec 2008 14:58:27 +0100 (CET) Received: from cx-pc-001 ([172.31.4.93]) by comxexch02.comx.local with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Dec 2008 14:58:26 +0100 Subject: [PATCH 3/3] NIU: Implement discard counters, optimize 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:58:26 +0100 Message-Id: <1229608706.16904.31.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-OriginalArrivalTime: 18 Dec 2008 13:58:26.0984 (UTC) FILETIME=[B32B5280:01C96118] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Optimize the lightly loaded case, by only syncronizing discards stats when qlen > 10 indicate potential for drops. Notice Robert Olsson might disagree with this patch. Signed-off-by: Jesper Dangaard Brouer --- drivers/net/niu.c | 4 +++- 1 files changed, 3 insertions(+), 1 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 9f6a98f..7746230 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -3620,7 +3620,9 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget) nw64(RX_DMA_CTL_STAT(rp->rx_channel), stat); - niu_sync_rx_discard_stats(np, rp, 0x7FFF); + /* Only sync discards stats when qlen indicate potential for drops */ + if (qlen > 10) + niu_sync_rx_discard_stats(np, rp, 0x7FFF); return work_done; }