diff options
author | yongari <yongari@FreeBSD.org> | 2010-09-16 17:32:37 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-09-16 17:32:37 +0000 |
commit | f46f8ca4210f647647f3bbe8e2d292c19cee5243 (patch) | |
tree | 98bccf73884db28d98108295c3aa52d8b86d36c4 | |
parent | 0bae586ec2aaf16e3346d79307cc3ddd34f6ffc8 (diff) | |
download | FreeBSD-src-f46f8ca4210f647647f3bbe8e2d292c19cee5243.zip FreeBSD-src-f46f8ca4210f647647f3bbe8e2d292c19cee5243.tar.gz |
Fix incorrect RX BD producer updates. The producer index was
already updated after allocating mbuf so driver had to use the last
index instead of using next producer index. This should fix driver
hang which may happen under high network load.
Reported by: Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
Tested by: Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
MFC after: 10 days
-rw-r--r-- | sys/dev/bge/if_bge.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index aff148f..0d1b871 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -3386,9 +3386,11 @@ bge_rxeof(struct bge_softc *sc, uint16_t rx_prod, int holdlck) sc->bge_rx_saved_considx = rx_cons; bge_writembx(sc, BGE_MBX_RX_CONS0_LO, sc->bge_rx_saved_considx); if (stdcnt) - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, (sc->bge_std + + BGE_STD_RX_RING_CNT - 1) % BGE_STD_RX_RING_CNT); if (jumbocnt) - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, (sc->bge_jumbo + + BGE_JUMBO_RX_RING_CNT - 1) % BGE_JUMBO_RX_RING_CNT); #ifdef notyet /* * This register wraps very quickly under heavy packet drops. |