]> git.baikalelectronics.ru Git - kernel.git/commit
[TG3]: Fix bug in tg3_rx()
authorMichael Chan <mchan@broadcom.com>
Mon, 25 Apr 2005 22:14:03 +0000 (15:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2005 22:14:03 +0000 (15:14 -0700)
commit5ecf01a0bc9fdb941ad081a4856aefe8de0d983e
tree885f84a0fe56ed5e3d793a5414c8ec5bb6c8a633
parent6dc7662ef18c23528203406732203ff3b17a3d6f
[TG3]: Fix bug in tg3_rx()

This patch fixes a bug that causes tg3_has_work() to always return 1.

rx work is determined by comparing tp->rx_rcb_ptr with the current hw
producer index. The hw producer index is modulo the ring size, but tp-
>rx_rcb_ptr is a free running counter that goes up beyond the ring size.
After the ring wraps around once, tg3_has_work() will always return 1.

The fix is to always do modulo arithmetic on tp->rx_rcb_ptr.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c