From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 16:09:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F4C8AD; Sun, 15 Mar 2015 16:09:41 +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 7688E2EE; Sun, 15 Mar 2015 16:09:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2FG9ffw033844; Sun, 15 Mar 2015 16:09:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2FG9eMc033841; Sun, 15 Mar 2015 16:09:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503151609.t2FG9eMc033841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Mar 2015 16:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280041 - 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.18-1 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, 15 Mar 2015 16:09:41 -0000 Author: mav Date: Sun Mar 15 16:09:39 2015 New Revision: 280041 URL: https://svnweb.freebsd.org/changeset/base/280041 Log: Fix networking problem after r280026. I've missed that network driver sometimes returns taken request back to available queue without processing. Add new helper function for that case. Reported by: flo MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Mar 15 15:29:03 2015 (r280040) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Mar 15 16:09:39 2015 (r280041) @@ -342,6 +342,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc * No more packets, but still some avail ring * entries. Interrupt if needed/appropriate. */ + vq_retchain(vq); vq_endchains(vq, 0); return; } Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Sun Mar 15 15:29:03 2015 (r280040) +++ head/usr.sbin/bhyve/virtio.c Sun Mar 15 16:09:39 2015 (r280041) @@ -372,8 +372,21 @@ loopy: } /* - * Return the currently-first request chain to the guest, setting - * its I/O length to the provided value. + * Return the currently-first request chain back to the available queue. + * + * (This chain is the one you handled when you called vq_getchain() + * and used its positive return value.) + */ +void +vq_retchain(struct vqueue_info *vq) +{ + + vq->vq_last_avail--; +} + +/* + * Return specified request chain to the guest, setting its I/O length + * to the provided value. * * (This chain is the one you handled when you called vq_getchain() * and used its positive return value.) Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Sun Mar 15 15:29:03 2015 (r280040) +++ head/usr.sbin/bhyve/virtio.h Sun Mar 15 16:09:39 2015 (r280041) @@ -453,6 +453,7 @@ void vi_set_io_bar(struct virtio_softc * int vq_getchain(struct vqueue_info *vq, uint16_t *pidx, struct iovec *iov, int n_iov, uint16_t *flags); +void vq_retchain(struct vqueue_info *vq); void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen); void vq_endchains(struct vqueue_info *vq, int used_all_avail);