summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
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/arch/sparc64
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/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/vnet.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c
index 0364bddfa7f..c7cac05fbf9 100644
--- a/sys/arch/sparc64/dev/vnet.c
+++ b/sys/arch/sparc64/dev/vnet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnet.c,v 1.16 2009/05/12 21:33:38 kettenis Exp $ */
+/* $OpenBSD: vnet.c,v 1.17 2009/08/09 11:40:58 deraadt Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
*
@@ -681,14 +681,10 @@ vnet_rx_vio_dring_data(struct vnet_softc *sc, struct vio_msg_tag *tag)
if (desc.hdr.dstate != VIO_DESC_READY)
break;
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if(m == NULL)
+ m = MCLGETI(NULL, M_DONTWAIT, &sc->sc_ac.ac_if,
+ MCLBYTES);
+ if (!m)
break;
- MCLGETI(m, M_DONTWAIT, &sc->sc_ac.ac_if, MCLBYTES);
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- break;
- }
ifp->if_ipackets++;
m->m_pkthdr.rcvif = ifp;
m->m_len = m->m_pkthdr.len = desc.nbytes;