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/dev/pci/if_bge.c | |
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/dev/pci/if_bge.c')
-rw-r--r-- | sys/dev/pci/if_bge.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index f03f1415002..8f8986974f1 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.279 2009/08/08 15:58:14 naddy Exp $ */ +/* $OpenBSD: if_bge.c,v 1.280 2009/08/09 11:40:56 deraadt Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -719,15 +719,9 @@ bge_newbuf(struct bge_softc *sc, int i) struct mbuf *m; int error; - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES); + if (!m) return (ENOBUFS); - - MCLGETI(m, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES); - if (!(m->m_flags & M_EXT)) { - m_freem(m); - return (ENOBUFS); - } m->m_len = m->m_pkthdr.len = MCLBYTES; if (!(sc->bge_flags & BGE_RX_ALIGNBUG)) m_adj(m, ETHER_ALIGN); @@ -776,15 +770,9 @@ bge_newbuf_jumbo(struct bge_softc *sc, int i) struct mbuf *m; int error; - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, BGE_JLEN); + if (!m) return (ENOBUFS); - - MCLGETI(m, M_DONTWAIT, &sc->arpcom.ac_if, BGE_JLEN); - if (!(m->m_flags & M_EXT)) { - m_freem(m); - return (ENOBUFS); - } m->m_len = m->m_pkthdr.len = BGE_JUMBO_FRAMELEN; if (!(sc->bge_flags & BGE_RX_ALIGNBUG)) m_adj(m, ETHER_ALIGN); |