summaryrefslogtreecommitdiff
path: root/sys/dev/ic/re.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/re.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/re.c')
-rw-r--r--sys/dev/ic/re.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index e3caa4bae14..e6cbd4bf963 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.113 2009/07/23 20:15:32 kettenis Exp $ */
+/* $OpenBSD: re.c,v 1.114 2009/08/09 11:40:58 deraadt Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1213,16 +1213,10 @@ re_newbuf(struct rl_softc *sc)
u_int32_t cmdstat;
int error, idx;
- 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);
- }
-
/*
* Initialize mbuf length fields and fixup
* alignment so that the frame payload is