svn commit: r212755 - head/sys/dev/bge
Pyun YongHyeon
yongari at FreeBSD.org
Thu Sep 16 17:32:37 UTC 2010
Author: yongari
Date: Thu Sep 16 17:32:37 2010
New Revision: 212755
URL: http://svn.freebsd.org/changeset/base/212755
Log:
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
Modified:
head/sys/dev/bge/if_bge.c
Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c Thu Sep 16 17:24:25 2010 (r212754)
+++ head/sys/dev/bge/if_bge.c Thu Sep 16 17:32:37 2010 (r212755)
@@ -3386,9 +3386,11 @@ bge_rxeof(struct bge_softc *sc, uint16_t
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.
More information about the svn-src-head
mailing list