From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUgFH-0003Vf-0a for qemu-devel@nongnu.org; Thu, 18 Sep 2014 14:15:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUgF8-0005jI-4K for qemu-devel@nongnu.org; Thu, 18 Sep 2014 14:15:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUgF7-0005iI-L6 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 14:15:46 -0400 Date: Thu, 18 Sep 2014 21:18:58 +0300 From: "Michael S. Tsirkin" Message-ID: <1411063757-29216-13-git-send-email-mst@redhat.com> References: <1411063757-29216-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1411063757-29216-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 12/15] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Damjan Marion , Anthony Liguori From: Damjan Marion Header length check should happen only if backend is kernel. For user backend there is no reason to reset this bit. vhost-user code does not define .has_vnet_hdr_len so VIRTIO_NET_F_MRG_RXBUF cannot be negotiated even if both sides support it. Signed-off-by: Damjan Marion Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/vhost_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index b21e7a4..77bb93e 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -163,11 +163,11 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) if (r < 0) { goto fail; } - if (!qemu_has_vnet_hdr_len(options->net_backend, - sizeof(struct virtio_net_hdr_mrg_rxbuf))) { - net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF); - } if (backend_kernel) { + if (!qemu_has_vnet_hdr_len(options->net_backend, + sizeof(struct virtio_net_hdr_mrg_rxbuf))) { + net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF); + } if (~net->dev.features & net->dev.backend_features) { fprintf(stderr, "vhost lacks feature mask %" PRIu64 " for backend\n", -- MST