diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-09 11:40:59 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-09 11:40:59 +0000 |
commit | 238ecfedf5eb81ff8e786e9cec23c9f422951a3a (patch) | |
tree | d8372c1a05c03969508d1bff93a0058199babb9b /sys/arch/socppc | |
parent | 4a5b03862209236ce66103e379544f2e1e0f8853 (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/arch/socppc')
-rw-r--r-- | sys/arch/socppc/dev/if_tsec.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/arch/socppc/dev/if_tsec.c b/sys/arch/socppc/dev/if_tsec.c index bca792b7a21..ca377948d2d 100644 --- a/sys/arch/socppc/dev/if_tsec.c +++ b/sys/arch/socppc/dev/if_tsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tsec.c,v 1.22 2009/02/22 20:03:19 kettenis Exp $ */ +/* $OpenBSD: if_tsec.c,v 1.23 2009/08/09 11:40:58 deraadt Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -1196,15 +1196,9 @@ tsec_alloc_mbuf(struct tsec_softc *sc, bus_dmamap_t map) { struct mbuf *m = NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + m = MCLGETI(NULL, M_DONTWAIT, &sc->sc_ac.ac_if, MCLBYTES); + if (!m) return (NULL); - - MCLGETI(m, M_DONTWAIT, &sc->sc_ac.ac_if, MCLBYTES); - if ((m->m_flags & M_EXT) == 0) { - m_freem(m); - return (NULL); - } m->m_len = m->m_pkthdr.len = MCLBYTES; if (bus_dmamap_load_mbuf(sc->sc_dmat, map, m, BUS_DMA_NOWAIT) != 0) { |