From: Damjan Marion Date: Thu, 11 Sep 2014 21:55:48 +0000 (-0700) Subject: vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation X-Git-Tag: v2.1.3~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09d552b40f79c53a7faa8c85a4ffc2dd52d7b94c;p=thirdparty%2Fqemu.git vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation 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 (cherry picked from commit d8e80ae37a7acfea416ad9abbe76b453a73d9cc0) Signed-off-by: Michael Roth --- diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index b37438ba091..7e3386ded4a 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",