ALTQ'ify.

This commit is contained in:
thorpej 2000-12-14 06:42:57 +00:00
parent 3ebe38e227
commit 1646284c95
4 changed files with 31 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sip.c,v 1.20 2000/11/15 01:02:15 thorpej Exp $ */
/* $NetBSD: if_sip.c,v 1.21 2000/12/14 06:42:57 thorpej Exp $ */
/*-
* Copyright (c) 1999 Network Computer, Inc.
@ -582,6 +582,7 @@ sip_attach(parent, self, aux)
ifp->if_watchdog = sip_watchdog;
ifp->if_init = sip_init;
ifp->if_stop = sip_stop;
IFQ_SET_READY(&ifp->if_snd);
/*
* Attach the interface.
@ -681,7 +682,7 @@ sip_start(ifp)
/*
* Grab a packet off the queue.
*/
IF_DEQUEUE(&ifp->if_snd, m0);
IFQ_POLL(&ifp->if_snd, m0);
if (m0 == NULL)
break;
@ -699,7 +700,6 @@ sip_start(ifp)
if (m == NULL) {
printf("%s: unable to allocate Tx mbuf\n",
sc->sc_dev.dv_xname);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
if (m0->m_pkthdr.len > MHLEN) {
@ -708,7 +708,6 @@ sip_start(ifp)
printf("%s: unable to allocate Tx "
"cluster\n", sc->sc_dev.dv_xname);
m_freem(m);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
}
@ -721,11 +720,12 @@ sip_start(ifp)
if (error) {
printf("%s: unable to load Tx buffer, "
"error = %d\n", sc->sc_dev.dv_xname, error);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
}
IFQ_DEQUEUE(&ifp->if_snd, m0);
/*
* Ensure we have enough descriptors free to describe
* the packet.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ti.c,v 1.15 2000/11/17 19:33:25 bouyer Exp $ */
/* $NetBSD: if_ti.c,v 1.16 2000/12/14 06:42:57 thorpej Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@ -1792,7 +1792,17 @@ static void ti_attach(parent, self, aux)
ifp->if_ioctl = ti_ioctl;
ifp->if_start = ti_start;
ifp->if_watchdog = ti_watchdog;
IFQ_SET_READY(&ifp->if_snd);
#if 0
/*
* XXX This is not really correct -- we don't necessarily
* XXX want to queue up as many as we can transmit at the
* XXX upper layer like that. Someone with a board should
* XXX check to see how this affects performance.
*/
ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
#endif
/*
* We can support 802.1Q VLAN-sized frames.
@ -2067,7 +2077,8 @@ static int ti_intr(xsc)
/* Re-enable interrupts. */
CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
if ((ifp->if_flags & IFF_RUNNING) != 0 &&
IFQ_IS_EMPTY(&ifp->if_snd) == 0)
ti_start(ifp);
return (1);
@ -2206,8 +2217,8 @@ static void ti_start(ifp)
prodidx = CSR_READ_4(sc, TI_MB_SENDPROD_IDX);
while(sc->ti_cdata.ti_tx_chain[prodidx] == NULL) {
IF_DEQUEUE(&ifp->if_snd, m_head);
while (sc->ti_cdata.ti_tx_chain[prodidx] == NULL) {
IFQ_POLL(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
@ -2217,11 +2228,12 @@ static void ti_start(ifp)
* for the NIC to drain the ring.
*/
if (ti_encap(sc, m_head, &prodidx)) {
IF_PREPEND(&ifp->if_snd, m_head);
ifp->if_flags |= IFF_OACTIVE;
break;
}
IFQ_DEQUEUE(&ifp->if_snd, m_head);
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.

View File

@ -1,4 +1,6 @@
/* $NetBSD: if_tl.c,v 1.37 2000/11/15 01:02:15 thorpej Exp $ */
/* $NetBSD: if_tl.c,v 1.38 2000/12/14 06:42:57 thorpej Exp $ */
/* XXX ALTQ XXX */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vr.c,v 1.41 2000/11/15 01:02:15 thorpej Exp $ */
/* $NetBSD: if_vr.c,v 1.42 2000/12/14 06:42:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -948,7 +948,7 @@ vr_start(ifp)
/*
* Grab a packet off the queue.
*/
IF_DEQUEUE(&ifp->if_snd, m0);
IFQ_POLL(&ifp->if_snd, m0);
if (m0 == NULL)
break;
@ -971,7 +971,6 @@ vr_start(ifp)
if (m == NULL) {
printf("%s: unable to allocate Tx mbuf\n",
sc->vr_dev.dv_xname);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
if (m0->m_pkthdr.len > MHLEN) {
@ -980,7 +979,6 @@ vr_start(ifp)
printf("%s: unable to allocate Tx "
"cluster\n", sc->vr_dev.dv_xname);
m_freem(m);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
}
@ -993,11 +991,12 @@ vr_start(ifp)
if (error) {
printf("%s: unable to load Tx buffer, "
"error = %d\n", sc->vr_dev.dv_xname, error);
IF_PREPEND(&ifp->if_snd, m0);
break;
}
}
IFQ_DEQUEUE(&ifp->if_snd, m0);
/* Sync the DMA map. */
bus_dmamap_sync(sc->vr_dmat, ds->ds_dmamap, 0,
ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_PREWRITE);
@ -1625,6 +1624,8 @@ vr_attach(parent, self, aux)
ifp->if_watchdog = vr_watchdog;
ifp->if_init = vr_init;
ifp->if_stop = vr_stop;
IFQ_SET_READY(&ifp->if_snd);
bcopy(sc->vr_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
/*