summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-09-16 17:32:37 +0000
committeryongari <yongari@FreeBSD.org>2010-09-16 17:32:37 +0000
commitf46f8ca4210f647647f3bbe8e2d292c19cee5243 (patch)
tree98bccf73884db28d98108295c3aa52d8b86d36c4 /sys/dev/bge
parent0bae586ec2aaf16e3346d79307cc3ddd34f6ffc8 (diff)
downloadFreeBSD-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
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c6
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.
OpenPOWER on IntegriCloud