summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-08-12 14:39:06 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-08-12 14:39:06 +0000
commit41f7beea342b39552a07eda8d3b742194d8e7d63 (patch)
tree32b74803f7554c6cd3660bd5b77eb8914c8cde9f /sys/net/if_ethersubr.c
parenta2ad26eeed1b3dec69c188b30427179069a1ca49 (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/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index d0166e2e84a..ba971536e3c 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.133 2009/06/05 00:05:21 claudio Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.134 2009/08/12 14:39:05 dlg Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -542,7 +542,14 @@ ether_input(ifp0, eh, m)
struct ether_header *eh_tmp;
#endif
- m_cluncount(m, 1);
+ /*
+ * the cluster is no longer on the ring, so don't count it against the
+ * ring. if the system wants the packet back we should give it back.
+ */
+ if (m_cluncount(m) != 0) {
+ m_freem(m);
+ return;
+ }
/* mark incomming routing domain */
m->m_pkthdr.rdomain = ifp->if_rdomain;