svn commit: r255167 - head/sys/dev/virtio/network
Bryan Venteicher
bryanv at FreeBSD.org
Tue Sep 3 02:28:32 UTC 2013
Author: bryanv
Date: Tue Sep 3 02:28:31 2013
New Revision: 255167
URL: http://svnweb.freebsd.org/changeset/base/255167
Log:
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.
Modified:
head/sys/dev/virtio/network/if_vtnet.c
head/sys/dev/virtio/network/if_vtnetvar.h
Modified: head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- head/sys/dev/virtio/network/if_vtnet.c Tue Sep 3 02:26:57 2013 (r255166)
+++ head/sys/dev/virtio/network/if_vtnet.c Tue Sep 3 02:28:31 2013 (r255167)
@@ -592,6 +592,9 @@ vtnet_setup_features(struct vtnet_softc
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
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_t
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);
Modified: head/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- head/sys/dev/virtio/network/if_vtnetvar.h Tue Sep 3 02:26:57 2013 (r255166)
+++ head/sys/dev/virtio/network/if_vtnetvar.h Tue Sep 3 02:28:31 2013 (r255167)
@@ -138,6 +138,7 @@ struct vtnet_softc {
#define VTNET_FLAG_MRG_RXBUFS 0x0080
#define VTNET_FLAG_LRO_NOMRG 0x0100
#define VTNET_FLAG_MULTIQ 0x0200
+#define VTNET_FLAG_EVENT_IDX 0x0400
int vtnet_link_active;
int vtnet_hdr_size;
More information about the svn-src-all
mailing list