From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKiG1-0005BZ-HT for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKiFx-00070P-CR for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:28:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKiFx-00070D-7p for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:27:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id B2BA38E25D for ; Thu, 30 Jul 2015 07:27:56 +0000 (UTC) References: <1438200409-27381-1-git-send-email-marcel@redhat.com> <1438200409-27381-2-git-send-email-marcel@redhat.com> <20150730094612-mutt-send-email-mst@redhat.com> From: Marcel Apfelbaum Message-ID: <55B9D1FA.4090400@redhat.com> Date: Thu, 30 Jul 2015 10:27:54 +0300 MIME-Version: 1.0 In-Reply-To: <20150730094612-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 1/2] vhost-user: sync backend features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: jasowang@redhat.com, famz@redhat.com, qemu-devel@nongnu.org On 07/30/2015 09:47 AM, Michael S. Tsirkin wrote: > On Wed, Jul 29, 2015 at 11:06:48PM +0300, Marcel Apfelbaum wrote: >> Complete vhost-user negotiation by syncing > > synching. OK, thanks > >> the features >> supported by the backend. >> >> Signed-off-by: Marcel Apfelbaum >> --- >> hw/virtio/vhost-user.c | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c >> index c4428a1..b522437 100644 >> --- a/hw/virtio/vhost-user.c >> +++ b/hw/virtio/vhost-user.c >> @@ -22,6 +22,7 @@ >> #include >> #include >> #include >> +#include >> >> #define VHOST_MEMORY_MAX_NREGIONS 8 >> >> @@ -358,6 +359,22 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) >> return err; >> } >> >> + if (__virtio_has_feature(msg.u64, VIRTIO_F_ANY_LAYOUT)) { >> + dev->backend_features |= 1ULL << VIRTIO_F_ANY_LAYOUT; >> + } >> + >> + if (__virtio_has_feature(msg.u64, VIRTIO_F_VERSION_1)) { >> + dev->backend_features |= 1ULL << VIRTIO_F_VERSION_1; >> + } >> + >> + if (__virtio_has_feature(msg.u64, VIRTIO_NET_F_MRG_RXBUF)) { >> + dev->backend_features |= 1ULL << VIRTIO_NET_F_MRG_RXBUF; >> + } >> + >> + if (__virtio_has_feature(msg.u64, VIRTIO_NET_F_MQ)) { >> + dev->backend_features |= 1ULL << VIRTIO_NET_F_MQ; >> + } >> + > > A bit too early for MQ, isn't it? For a complete solution, until we have it in protocol features > >> if (__virtio_has_feature(msg.u64, VHOST_USER_F_PROTOCOL_FEATURES)) { >> dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES; >> >> -- >> 2.1.0