Skip to content

Commit

Permalink
NIU: Implement discard counters, optimize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Dangaard Brouer authored and David S. Miller committed Dec 19, 2008
1 parent d231776 commit e98def1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e98def1

Please sign in to comment.