summaryrefslogtreecommitdiff
path: root/sys/dev/ic/hme.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/hme.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/hme.c')
-rw-r--r--sys/dev/ic/hme.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index e5fa4e266ad..3c5a9413a59 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.58 2009/06/22 14:31:04 sthen Exp $ */
+/* $OpenBSD: hme.c,v 1.59 2009/08/09 11:40:58 deraadt Exp $ */
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
/*-
@@ -1415,17 +1415,11 @@ hme_newbuf(sc, d)
* until we're sure everything is a success.
*/
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
+ m = MCLGETI(NULL, M_DONTWAIT, &sc->sc_arpcom.ac_if, MCLBYTES);
+ if (!m)
return (ENOBUFS);
m->m_pkthdr.rcvif = &sc->sc_arpcom.ac_if;
- MCLGETI(m, M_DONTWAIT, &sc->sc_arpcom.ac_if, MCLBYTES);
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return (ENOBUFS);
- }
-
if (bus_dmamap_load(sc->sc_dmatag, sc->sc_rxmap_spare,
mtod(m, caddr_t), MCLBYTES - HME_RX_OFFSET, NULL,
BUS_DMA_NOWAIT) != 0) {