summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2017-02-07 06:27:19 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2017-02-07 06:27:19 +0000
commit3def434406dd35e516b3403fdf0a4b10e0f1d6a1 (patch)
treefc93c7b980d0639e8110c24da1d2a5668bfb2e64 /sys/kern/uipc_mbuf.c
parent67259ed012fcb8343cbfa262f910f4f6d3d25fa3 (diff)
add m_pool_init(), a wrapper around pool_init for mbuf clusters.
m_pool_init is basically a call to pool_init with everythign except the size and alignment specified, and a call to pool_set_constraints so the memroy is always dma reachable. it also wires up the memory with the custom mbuf pool allocator. ok bluhm@ as part of a larger diff
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 94176d309f6..07879fc6c82 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.242 2017/02/07 06:21:37 dlg Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.243 2017/02/07 06:27:18 dlg Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -1442,6 +1442,13 @@ m_pool_free(struct pool *pp, void *v)
mtx_leave(&m_pool_mtx);
}
+void
+m_pool_init(struct pool *pp, u_int size, u_int align, const char *wmesg)
+{
+ pool_init(pp, size, align, IPL_NET, 0, wmesg, &m_pool_allocator);
+ pool_set_constraints(pp, &kp_dma_contig);
+}
+
#ifdef DDB
void
m_print(void *v,