From owner-svn-src-all@FreeBSD.ORG Mon Apr 20 10:29:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDF84EC8; Mon, 20 Apr 2015 10:29:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6E1B18; Mon, 20 Apr 2015 10:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3KATgbN050968; Mon, 20 Apr 2015 10:29:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3KATgM4050967; Mon, 20 Apr 2015 10:29:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504201029.t3KATgM4050967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 20 Apr 2015 10:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281764 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 10:29:43 -0000 Author: mav Date: Mon Apr 20 10:29:42 2015 New Revision: 281764 URL: https://svnweb.freebsd.org/changeset/base/281764 Log: 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. Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 20 09:07:12 2015 (r281763) +++ head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 20 10:29:42 2015 (r281764) @@ -393,6 +393,7 @@ pci_vtnet_ping_rxq(void *vsc, struct vqu */ 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 vqu /* 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);