diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-12-14 22:31:47 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-12-14 22:31:47 +0000 |
commit | 999a06773175fca56ed55a5375c8d52ad0539f8b (patch) | |
tree | d8bf4d6bfee09c79afcc4989da29b10bbc014dc3 | |
parent | 246801b33c942e2bc62ca994cf8b5bb720784d7f (diff) |
Make sure the low water mark for cluster pools isn't 0 such that network
drivers are guaranteed to make progress. We could probably set it to 1,
but we set it to 2, to make sure drivers that link descriptors don't link
a descriptor back to itself.
ok deraadt@, dlg@
-rw-r--r-- | sys/kern/uipc_mbuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 19a146798f3..728e0e9c28c 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.110 2008/12/13 00:18:46 deraadt Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.111 2008/12/14 22:31:46 kettenis Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -278,6 +278,8 @@ m_clinitifp(struct ifnet *ifp) /* Initialize high water marks for use of cluster pools */ for (i = 0; i < MCLPOOLS; i++) { + if (mclp[i].mcl_lwm == 0) + mclp[i].mcl_lwm = 2; mclp[i].mcl_hwm = MAX(4, mclp[i].mcl_lwm); mclp[i].mcl_size = mclsizes[i]; } @@ -326,7 +328,7 @@ m_cldrop(struct ifnet *ifp, int pi) mclp = aifp->if_data.ifi_mclpool; for (i = 0; i < nitems(aifp->if_data.ifi_mclpool); i++) mclp[i].mcl_hwm = - max(mclp[i].mcl_hwm / 2,mclp[i].mcl_lwm); + max(mclp[i].mcl_hwm / 2, mclp[i].mcl_lwm); } } else if (m_livelock && ticks - liveticks > 5) m_livelock = 0; /* Let the high water marks grow again */ |