summaryrefslogtreecommitdiff
path: root/sys/dev/ic/gem.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-09 11:40:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-09 11:40:59 +0000
commit238ecfedf5eb81ff8e786e9cec23c9f422951a3a (patch)
treed8372c1a05c03969508d1bff93a0058199babb9b /sys/dev/ic/gem.c
parent4a5b03862209236ce66103e379544f2e1e0f8853 (diff)
MCLGETI() will now allocate a mbuf header if it is not provided, thus
reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
Diffstat (limited to 'sys/dev/ic/gem.c')
-rw-r--r--sys/dev/ic/gem.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index 851010ab767..9a02283a960 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.93 2009/08/03 11:09:10 sthen Exp $ */
+/* $OpenBSD: gem.c,v 1.94 2009/08/09 11:40:58 deraadt Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -1006,15 +1006,9 @@ gem_add_rxbuf(struct gem_softc *sc, int idx)
struct mbuf *m;
int error;
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
+ m = MCLGETI(NULL, M_DONTWAIT, &sc->sc_arpcom.ac_if, MCLBYTES);
+ if (!m)
return (ENOBUFS);
-
- MCLGETI(m, M_DONTWAIT, &sc->sc_arpcom.ac_if, MCLBYTES);
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return (ENOBUFS);
- }
m->m_len = m->m_pkthdr.len = MCLBYTES;
#ifdef GEM_DEBUG