Reverse the stopgap change made in revision 1.29:

date: 1998/08/01 01:47:24;  author: thorpej;  state: Exp;  lines: +18 -8
Don't call the protocol drain routines if how == M_NOWAIT, which typically
means we're in interrupt context.  Since we can be called from a network
hardware interrupt, we could corrupt the protocol queues we try to drain
them at that time.

The problem has been addressed by letting the drain'able protocols use
a locking scheme to prevent queue corruption.
This commit is contained in:
thorpej 1998-12-18 21:40:14 +00:00
parent 4f177aec90
commit 489d6d0e46

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_mbuf.c,v 1.32 1998/08/28 20:05:48 thorpej Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.33 1998/12/18 21:40:14 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1991, 1993
@ -168,19 +168,11 @@ m_reclaim(how)
struct ifnet *ifp;
int s = splimp();
/*
* Don't call the protocol drain routines if how == M_NOWAIT, which
* typically means we're in interrupt context. Since we can be
* called from a network hardware interrupt, we could corrupt the
* protocol queues we try to drain them at that time.
*/
if (how == M_WAIT) {
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw;
pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_drain)
(*pr->pr_drain)();
}
for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list))
if (ifp->if_drain)
(*ifp->if_drain)(ifp);