From 999a06773175fca56ed55a5375c8d52ad0539f8b Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 14 Dec 2008 22:31:47 +0000 Subject: 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@ --- sys/kern/uipc_mbuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern') 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 */ -- cgit v1.2.3