• Michael Chan's avatar
    [TG3]: Fix bug in tg3_rx() · 483ba50b
    Michael Chan authored
    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: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    483ba50b
tg3.c 271 KB