summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2005-03-12 17:35:37 +0000
committermlaier <mlaier@FreeBSD.org>2005-03-12 17:35:37 +0000
commit923d1a6714d8dec976440f3dcbf98c0ba45b6bf7 (patch)
tree2baccad73a4d1f191dcb219b920ac5326cdbe633 /sys/dev/re
parent24a06782ed706d41ac22a33c7bb277cc49931e12 (diff)
downloadFreeBSD-src-923d1a6714d8dec976440f3dcbf98c0ba45b6bf7.zip
FreeBSD-src-923d1a6714d8dec976440f3dcbf98c0ba45b6bf7.tar.gz
ALTQ support for re(4).
Submitted by: Chris Dionissopoulos, Theo Schlossnagle PR: kern/78681 MFC after: 2 weeks
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 77f2942..d458aa7 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -717,6 +717,7 @@ re_diag(sc)
CSR_WRITE_2(sc, RL_ISR, 0xFFFF);
RL_UNLOCK(sc);
+ /* XXX: re_diag must not be called when in ALTQ mode */
IF_HANDOFF(&ifp->if_snd, m0, ifp);
RL_LOCK(sc);
m0 = NULL;
@@ -1206,7 +1207,9 @@ re_attach(dev)
ifp->if_baudrate = 1000000000;
else
ifp->if_baudrate = 100000000;
- ifp->if_snd.ifq_maxlen = RL_IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, RL_IFQ_MAXLEN);
+ ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN;
+ IFQ_SET_READY(&ifp->if_snd);
ifp->if_capenable = ifp->if_capabilities & ~IFCAP_HWCSUM;
callout_handle_init(&sc->rl_stat_ch);
@@ -1788,7 +1791,7 @@ re_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
re_rxeof(sc);
re_txeof(sc);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(ifp->if_snd))
re_start_locked(ifp);
if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */
@@ -1872,7 +1875,7 @@ re_intr(arg)
}
}
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
re_start_locked(ifp);
done_locked:
@@ -2009,7 +2012,7 @@ re_start_locked(ifp)
{
struct rl_softc *sc;
struct mbuf *m_head = NULL;
- int idx;
+ int idx, queued = 0;
sc = ifp->if_softc;
@@ -2018,12 +2021,12 @@ re_start_locked(ifp)
idx = sc->rl_ldata.rl_tx_prodidx;
while (sc->rl_ldata.rl_tx_mbuf[idx] == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
if (re_encap(sc, &m_head, &idx)) {
- IF_PREPEND(&ifp->if_snd, m_head);
+ IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
ifp->if_flags |= IFF_OACTIVE;
break;
}
@@ -2033,8 +2036,13 @@ re_start_locked(ifp)
* to him.
*/
BPF_MTAP(ifp, m_head);
+
+ queued++;
}
+ if (queued == 0)
+ return;
+
/* Flush the TX descriptors */
bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag,
OpenPOWER on IntegriCloud