From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 81062160 for ; Wed, 25 Jul 2018 03:24:10 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 18:24:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,399,1526367600"; d="scan'208";a="59221866" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.228]) by orsmga007.jf.intel.com with ESMTP; 24 Jul 2018 18:24:07 -0700 Date: Wed, 25 Jul 2018 09:23:51 +0800 From: Tiwei Bie To: Marvin Liu Cc: dev@dpdk.org, maxime.coquelin@redhat.com, zhihong.wang@intel.com Message-ID: <20180725012350.GA20566@debian> References: <20180724151649.44490-1-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180724151649.44490-1-yong.liu@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) Subject: Re: [dpdk-dev] [PATCH] examples/vhost: fix qemu abort X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 01:24:11 -0000 On Tue, Jul 24, 2018 at 11:16:49PM +0800, Marvin Liu wrote: > When start vhost sample with builtin-net-driver argument, vhost feature > bit will be zero. If VHOST_USER_F_PROTOCOL_FEATURES is not set, vhost > net start will be failed in qemu. This occasion will cause device stop > action was skipped. Consequently, same ioevent fd will be added second > time after reload driver and then cause qemu abort. Add feature bit > which has been supported by vhost library can fix this error. > > Fixes: ca059fa5 ("examples/vhost: demonstrate the new generic APIs") It's a bug in QEMU, this is a workaround in DPDK. So there is no need to fix any commit in DPDK. > > Signed-off-by: Marvin Liu > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 2175c1186..44aec2f47 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -1520,7 +1520,8 @@ main(int argc, char *argv[]) > } > > if (builtin_net_driver) > - rte_vhost_driver_set_features(file, VIRTIO_NET_FEATURES); There is no need to remove VIRTIO_NET_FEATURES although it's defined to 0 (as it's helpful for users to understand this example). > + rte_vhost_driver_set_features(file, > + 1ULL << VHOST_USER_F_PROTOCOL_FEATURES); It's better to add some comments that this is a workaround and why this workaround is needed. > > if (mergeable == 0) { > rte_vhost_driver_disable_features(file, > -- > 2.17.0 >