summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket2.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2008-11-24 12:57:37 +0000
committerdlg <dlg@openbsd.org>2008-11-24 12:57:37 +0000
commit785815dcc59a9832908e068b076cefc16ccf4639 (patch)
tree15fabf55153fbf1540c06d28956e4f6d44e95e46 /sys/kern/uipc_socket2.c
parentImplement link-state tracking on the routing table. Routes to interfaces (diff)
downloadwireguard-openbsd-785815dcc59a9832908e068b076cefc16ccf4639.tar.xz
wireguard-openbsd-785815dcc59a9832908e068b076cefc16ccf4639.zip
add several backend pools to allocate mbufs clusters of various sizes out
of. currently limited to MCLBYTES (2048 bytes) and 4096 bytes until pools can allocate objects of sizes greater than PAGESIZE. this allows drivers to ask for "jumbo" packets to fill rx rings with. the second half of this change is per interface mbuf cluster allocator statistics. drivers can use the new interface (MCLGETI), which will use these stats to selectively fail allocations based on demand for mbufs. if the driver isnt rapidly consuming rx mbufs, we dont allow it to allocate many to put on its rx ring. drivers require modifications to take advantage of both the new allocation semantic and large clusters. this was written and developed with deraadt@ over the last two days ok deraadt@ claudio@
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r--sys/kern/uipc_socket2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 1cf4403f75d..647edfce827 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.44 2008/05/23 15:51:12 thib Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.45 2008/11/24 12:57:37 dlg Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -58,7 +58,7 @@ const char netlck[] = "netlck";
u_long sb_max = SB_MAX; /* patchable */
-extern struct pool mclpool;
+extern struct pool mclpools[];
/*
* Procedures to manipulate state flags of socket
@@ -158,7 +158,7 @@ sonewconn(struct socket *head, int connstatus)
splassert(IPL_SOFTNET);
- if (mclpool.pr_nout > mclpool.pr_hardlimit * 95 / 100)
+ if (mclpools[0].pr_nout > mclpools[0].pr_hardlimit * 95 / 100)
return ((struct socket *)0);
if (head->so_qlen + head->so_q0len > head->so_qlimit * 3)
return ((struct socket *)0);
@@ -407,7 +407,7 @@ int
sbcheckreserve(u_long cnt, u_long defcnt)
{
if (cnt > defcnt &&
- mclpool.pr_nout> mclpool.pr_hardlimit / 2)
+ mclpools[0].pr_nout> mclpools[0].pr_hardlimit / 2)
return (ENOBUFS);
return (0);
}