NIU: Implement discard counters, optimize
authorJesper Dangaard Brouer <hawk@comx.dk>
Fri, 19 Dec 2008 03:51:56 +0000 (19:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Dec 2008 06:27:41 +0000 (22:27 -0800)
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 <hawk@comx.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/niu.c

index 671721c8ca65b5d1515a9868c5c5a26d7cb137dd..f219f16ec97a25b65f76c43928ca1f59a2ff077a 100644 (file)
@@ -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;
 }