summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-09-02 18:14:22 +0000
committerdm <dm@cvs.openbsd.org>1996-09-02 18:14:22 +0000
commit034a7517a6aca9a9d6d6c5c8272734e055649a1c (patch)
treeae1c3441bdac4a3aa2a3d563b6ef655e5ea9e866
parent9150de05a8f19f682fd7c79d1eac7110e77502cc (diff)
Don't drain the protocol queues at interrupt level.
-rw-r--r--sys/kern/uipc_mbuf.c14
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/sys/mbuf.h4
3 files changed, 19 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index efd54f99140..b37aa24a2e0 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.3 1996/06/20 10:50:22 deraadt Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.4 1996/09/02 18:14:15 dm Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -53,6 +53,7 @@
extern vm_map_t mb_map;
struct mbuf *mbutl;
char *mclrefcnt;
+int needqueuedrain;
void
mbinit()
@@ -120,6 +121,11 @@ m_retry(i, t)
{
register struct mbuf *m;
+ if (i & M_DONTWAIT) {
+ needqueuedrain = 1;
+ setsoftnet ();
+ return (NULL);
+ }
m_reclaim();
#define m_retry(i, t) (struct mbuf *)0
MGET(m, i, t);
@@ -136,6 +142,11 @@ m_retryhdr(i, t)
{
register struct mbuf *m;
+ if (i & M_DONTWAIT) {
+ needqueuedrain = 1;
+ setsoftnet ();
+ return (NULL);
+ }
m_reclaim();
#define m_retryhdr(i, t) (struct mbuf *)0
MGETHDR(m, i, t);
@@ -150,6 +161,7 @@ m_reclaim()
register struct protosw *pr;
int s = splimp();
+ needqueuedrain = 0;
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_drain)
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index c004bf3b83a..56ee3eabadf 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.16 1996/08/14 07:50:13 deraadt Exp $ */
+/* $OpenBSD: ip_input.c,v 1.17 1996/09/02 18:14:19 dm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -182,6 +182,8 @@ ipintr()
struct ipqent *ipqe;
int hlen, mff, s;
+ if (needqueuedrain)
+ m_reclaim ();
next:
/*
* Get next datagram off input queue and get IP header
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index c18ff3236e8..27c3e2bda9c 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.2 1996/03/03 12:12:00 niklas Exp $ */
+/* $OpenBSD: mbuf.h,v 1.3 1996/09/02 18:14:21 dm Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -360,6 +360,8 @@ int max_protohdr; /* largest protocol header */
int max_hdr; /* largest link+protocol header */
int max_datalen; /* MHLEN - max_hdr */
extern int mbtypes[]; /* XXX */
+extern int needqueuedrain; /* True if allocation failed at */
+ /* interrupt level */
void mbinit __P((void));
struct mbuf *m_copym __P((struct mbuf *, int, int, int));