summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-04-20 10:29:42 +0000
committermav <mav@FreeBSD.org>2015-04-20 10:29:42 +0000
commit0c201fb9ee118919e6fde8097f3e2aa20f810607 (patch)
treea40f877b211983a54dcf32db1a14fad5c1669adb /usr.sbin/bhyve
parentbab9ff9c31a6c6fc7e3daadc9a3eb5df219aa7a2 (diff)
downloadFreeBSD-src-0c201fb9ee118919e6fde8097f3e2aa20f810607.zip
FreeBSD-src-0c201fb9ee118919e6fde8097f3e2aa20f810607.tar.gz
Disable RX/TX queues notifications when not needed.
This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index 457a405..e6a5576 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -393,6 +393,7 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq)
*/
if (sc->vsc_rx_ready == 0) {
sc->vsc_rx_ready = 1;
+ vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY;
}
}
@@ -438,6 +439,7 @@ pci_vtnet_ping_txq(void *vsc, struct vqueue_info *vq)
/* Signal the tx thread for processing */
pthread_mutex_lock(&sc->tx_mtx);
+ vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY;
if (sc->tx_in_progress == 0)
pthread_cond_signal(&sc->tx_cond);
pthread_mutex_unlock(&sc->tx_mtx);
@@ -466,6 +468,7 @@ pci_vtnet_tx_thread(void *param)
for (;;) {
/* note - tx mutex is locked here */
do {
+ vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY;
if (sc->resetting)
have_work = 0;
else
@@ -478,6 +481,7 @@ pci_vtnet_tx_thread(void *param)
assert(error == 0);
}
} while (!have_work);
+ vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY;
sc->tx_in_progress = 1;
pthread_mutex_unlock(&sc->tx_mtx);
OpenPOWER on IntegriCloud