From e98def1f71fa0a6a37e12a56eb52ce5ed9e2e800 Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Thu, 18 Dec 2008 19:51:56 -0800 Subject: [PATCH] NIU: Implement discard counters, optimize Optimize the lightly loaded case, by only synchronizing discards stats when qlen > 10 indicate potential for drops. Notice Robert Olsson might disagree with this patch. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller --- drivers/net/niu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 671721c8ca65..f219f16ec97a 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -3618,7 +3618,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; } -- GitLab