netdev.vger.kernel.org archive mirror
 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 3/3] NIU: Implement discard counters, optimize
Date: Thu, 18 Dec 2008 14:58:26 +0100	[thread overview]
Message-ID: <1229608706.16904.31.camel@localhost.localdomain> (raw)
In-Reply-To: <1229608331.16904.23.camel@localhost.localdomain>


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 <hawk@comx.dk>
---

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

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



  parent reply	other threads:[~2008-12-18 13:58 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 ` [PATCH 2/3] NIU: Implement discard counters, info/debug statements Jesper Dangaard Brouer
2008-12-18 13:58 ` Jesper Dangaard Brouer [this message]
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=1229608706.16904.31.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;
as well as URLs for NNTP newsgroup(s).