diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-08-12 14:39:06 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-08-12 14:39:06 +0000 |
commit | 41f7beea342b39552a07eda8d3b742194d8e7d63 (patch) | |
tree | 32b74803f7554c6cd3660bd5b77eb8914c8cde9f /sys/dev/pci | |
parent | a2ad26eeed1b3dec69c188b30427179069a1ca49 (diff) |
if we get dangerously low on clusters during interrupts, we need
to free some for use on the rx rings on network cards.
this modifies m_cluncount to advise callers when we're in such a
situation, and makes them responsible for freeing up the cluster
for allocation by MCLGETI later.
fixes an awesome lockup with sis(4) henning has been experiencing.
this is not the best fix, but it is better than the current situation.
yep deraadt@ tested by henning@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_em.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/if_ix.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 394e0b1acef..9d7ef0b9f13 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.217 2009/08/10 19:41:05 deraadt Exp $ */ +/* $OpenBSD: if_em.c,v 1.218 2009/08/12 14:39:05 dlg Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2649,10 +2649,12 @@ em_rxeof(struct em_softc *sc, int count) sc->last_rx_desc_filled); } - m_cluncount(m, 1); sc->rx_ndescs--; + if (m_cluncount(m) == 0) + accept_frame = 1; + else + accept_frame = 0; - accept_frame = 1; prev_len_adj = 0; desc_len = letoh16(desc->length); diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index b12507f6ac9..9a277f85ff5 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.26 2009/08/10 19:41:05 deraadt Exp $ */ +/* $OpenBSD: if_ix.c,v 1.27 2009/08/12 14:39:05 dlg Exp $ */ /****************************************************************************** @@ -2631,10 +2631,12 @@ ixgbe_rxeof(struct rx_ring *rxr, int count) rxr->last_rx_desc_filled); } - m_cluncount(m, 1); rxr->rx_ndescs--; + if (m_cluncount(m) == 0) + accept_frame = 1; + else + accept_frame = 0; - accept_frame = 1; prev_len_adj = 0; desc_len = letoh16(rxdesc->wb.upper.length); |