aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio/network/if_vtnet.c
diff options
context:
space:
mode:
authorBryan Venteicher <bryanv@FreeBSD.org>2013-09-03 02:28:31 +0000
committerBryan Venteicher <bryanv@FreeBSD.org>2013-09-03 02:28:31 +0000
commit6e03f31982991599e168253d3fe8629786803398 (patch)
tree5fdbd92d2724e50584b262915b234470fd61c56f /sys/dev/virtio/network/if_vtnet.c
parent4142b1cbe57b3bc3ec3e47dadc1d8cc7b02f2dc2 (diff)
downloadsrc-6e03f31982991599e168253d3fe8629786803398.tar.gz
src-6e03f31982991599e168253d3fe8629786803398.zip
Complete any pending Tx frames before attempting the next transmit
Also complete pending frames in the watchdog function when the EVENT_IDX feature was negotiated just in case the completion interrupt was postponed.
Notes
Notes: svn path=/head/; revision=255167
Diffstat (limited to 'sys/dev/virtio/network/if_vtnet.c')
-rw-r--r--sys/dev/virtio/network/if_vtnet.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 5ab4b970bc72..93c60075ebce 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -592,6 +592,9 @@ vtnet_setup_features(struct vtnet_softc *sc)
vtnet_negotiate_features(sc);
+ if (virtio_with_feature(dev, VIRTIO_RING_F_EVENT_IDX))
+ sc->vtnet_flags |= VTNET_FLAG_EVENT_IDX;
+
if (virtio_with_feature(dev, VIRTIO_NET_F_MAC)) {
/* This feature should always be negotiated. */
sc->vtnet_flags |= VTNET_FLAG_MAC;
@@ -2155,6 +2158,8 @@ vtnet_start_locked(struct vtnet_txq *txq, struct ifnet *ifp)
sc->vtnet_link_active == 0)
return;
+ vtnet_txq_eof(txq);
+
while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
if (virtqueue_full(vq))
break;
@@ -2226,6 +2231,8 @@ vtnet_txq_mq_start_locked(struct vtnet_txq *txq, struct mbuf *m)
return (error);
}
+ vtnet_txq_eof(txq);
+
while ((m = drbr_peek(ifp, br)) != NULL) {
error = vtnet_txq_encap(txq, &m);
if (error) {
@@ -2471,6 +2478,8 @@ vtnet_watchdog(struct vtnet_txq *txq)
sc = txq->vtntx_sc;
VTNET_TXQ_LOCK(txq);
+ if (sc->vtnet_flags & VTNET_FLAG_EVENT_IDX)
+ vtnet_txq_eof(txq);
if (txq->vtntx_watchdog == 0 || --txq->vtntx_watchdog) {
VTNET_TXQ_UNLOCK(txq);
return (0);