From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 01:03:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49A4BC98; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC7F1155; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S130LG047938; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S130A9047932; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304280103.r3S130A9047932@svn.freebsd.org> From: Neel Natu Date: Sun, 28 Apr 2013 01:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250009 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 01:03:03 -0000 Author: neel Date: Sun Apr 28 01:02:59 2013 New Revision: 250009 URL: http://svnweb.freebsd.org/changeset/base/250009 Log: Get rid of the 'vsc_rxpend' state - it doesn't serve any purpose because we drop any frames that arrive while the device is starved for receive buffers. This makes the receive path to only execute in context of the receive thread and allows for further simplification. Reviewed by: grehan 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 Sun Apr 28 00:57:47 2013 (r250008) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Apr 28 01:02:59 2013 (r250009) @@ -140,7 +140,6 @@ struct pci_vtnet_softc { int vsc_isr; int vsc_tapfd; int vsc_rx_ready; - int vsc_rxpend; int tx_in_progress; int resetting; @@ -323,14 +322,6 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc if (ndescs == 0) { /* - * Need to wait for host notification to read - */ - if (sc->vsc_rxpend == 0) { - WPRINTF(("vtnet: no rx descriptors !\n")); - sc->vsc_rxpend = 1; - } - - /* * Drop the packet and try later */ (void) read(sc->vsc_tapfd, dummybuf, sizeof(dummybuf)); @@ -417,17 +408,6 @@ pci_vtnet_ping_rxq(struct pci_vtnet_soft if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; } - - /* - * If the rx queue was empty, attempt to receive a - * packet that was previously blocked due to no rx bufs - * available - */ - if (sc->vsc_rxpend) { - WPRINTF(("vtnet: rx resumed\n\r")); - sc->vsc_rxpend = 0; - pci_vtnet_tap_rx(sc); - } } static void