kern/134548: bge(4) panics on shutdown under heavy traffic load
Xin LI
delphij at delphij.net
Thu May 14 21:50:05 UTC 2009
The following reply was made to PR kern/134548; it has been noted by GNATS.
From: Xin LI <delphij at delphij.net>
To: bug-followup at FreeBSD.org, pisymbol at gmail.com
Cc:
Subject: Re: kern/134548: bge(4) panics on shutdown under heavy traffic load
Date: Thu, 14 May 2009 14:40:59 -0700
This is a multi-part message in MIME format.
--------------010504020606080505020502
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
My version of the patch:
- Check IFF_RUNNING right after softc lock is re-obtained.
- Avoid txeof calls after rxeof calls if IFF_RUNNING is disabled.
--------------010504020606080505020502
Content-Type: text/plain;
name="if_bge.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="if_bge.c.diff"
Index: if_bge.c
===================================================================
--- if_bge.c (revision 191995)
+++ if_bge.c (working copy)
@@ -3073,7 +3073,7 @@ bge_rxeof(struct bge_softc *sc)
bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag,
sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD);
- while(sc->bge_rx_saved_considx !=
+ while (sc->bge_rx_saved_considx !=
sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) {
struct bge_rx_bd *cur_rx;
uint32_t rxidx;
@@ -3193,6 +3193,9 @@ bge_rxeof(struct bge_softc *sc)
BGE_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
BGE_LOCK(sc);
+
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+ return;
}
if (stdcnt > 0)
@@ -3301,6 +3304,10 @@ bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int
sc->rxcycles = count;
bge_rxeof(sc);
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ BGE_UNLOCK(sc);
+ return;
+ }
bge_txeof(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
bge_start_locked(ifp);
@@ -3370,7 +3377,9 @@ bge_intr(void *xsc)
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
/* Check RX return ring producer/consumer. */
bge_rxeof(sc);
+ }
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
/* Check TX ring producer/consumer. */
bge_txeof(sc);
}
--------------010504020606080505020502--
More information about the freebsd-bugs
mailing list