summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2008-11-24 13:10:16 +0000
committerdlg <dlg@openbsd.org>2008-11-24 13:10:16 +0000
commitd69c8917775d39aa7d38096148aa622c58f277df (patch)
treefe395e268b47ccc7fdf8c164e9f4c16171cb18bc /sys
parentadd several backend pools to allocate mbufs clusters of various sizes out (diff)
downloadwireguard-openbsd-d69c8917775d39aa7d38096148aa622c58f277df.tar.xz
wireguard-openbsd-d69c8917775d39aa7d38096148aa622c58f277df.zip
switch from using MCLGET to MCLGETI for clusters going onto the rx ring.
this causes vic to start up with 4 mbufs on the ring, and the allocator will let it increase the number of rx mbufs as usage demands. testing shows that i need only 20 to 30 mbufs on the rx ring to cope with full speed io. we used to always put 100 on the ring, so we're now saving 140k of kernerl virtual address space (70 * MCLBYTES). this relies on the previous commit that copes with failures of mbuf allocation in the rx path. similar changes must be made to all the other drivers. i'll happily review diffs people send in. SUBTLE HINTS ARE COMING YOUR WAY.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_vic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index dfc69993687..2f3ccc9e8e0 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.57 2008/11/24 12:34:29 dlg Exp $ */
+/* $OpenBSD: if_vic.c,v 1.58 2008/11/24 13:10:16 dlg Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -1362,7 +1362,7 @@ vic_alloc_mbuf(struct vic_softc *sc, bus_dmamap_t map)
if (m == NULL)
return (NULL);
- MCLGET(m, M_DONTWAIT);
+ MCLGETI(m, M_DONTWAIT, &sc->sc_ac.ac_if, MCLBYTES);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
return (NULL);