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_bnx.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_bnx.c')
-rw-r--r-- | sys/dev/pci/if_bnx.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index e0f0de5c17a..3bf0151bdf1 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.82 2009/08/06 19:53:13 sthen Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.83 2009/08/09 11:40:56 deraadt Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -3591,16 +3591,9 @@ bnx_get_buf(struct bnx_softc *sc, u_int16_t *prod, *prod_bseq); /* This is a new mbuf allocation. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES); + if (!m) return (ENOBUFS); - - /* Attach a cluster to the mbuf. */ - 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; /* the chip aligns the ip header for us, no need to m_adj */ |