From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AC346324B for ; Wed, 25 Jul 2018 08:39:55 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 23:39:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,400,1526367600"; d="scan'208";a="67343690" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.228]) by FMSMGA003.fm.intel.com with ESMTP; 24 Jul 2018 23:39:45 -0700 Date: Wed, 25 Jul 2018 14:39:29 +0800 From: Tiwei Bie To: Marvin Liu Cc: dev@dpdk.org Message-ID: <20180725063929.GA12443@debian> References: <20180724151649.44490-1-yong.liu@intel.com> <20180725102556.68604-1-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180725102556.68604-1-yong.liu@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) Subject: Re: [dpdk-dev] [PATCH v3] examples/vhost: workaround 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 06:39:56 -0000 On Wed, Jul 25, 2018 at 06:25:56PM +0800, Marvin Liu wrote: > Current qemu vhost net ring start has a dependency on feature bit > VHOST_USER_F_PROTOCOL_FEATURES. Without this feature, vhost ring can't > enabled and ioevent fd won't be deleted after vhost device stop. That > will cause qemu abort when reloading driver. Work around qemu issues by > enabling feature bit in vhost user backend. > > Signed-off-by: Marvin Liu > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 2175c1186..8573004dd 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -1520,7 +1520,10 @@ main(int argc, char *argv[]) > } > > if (builtin_net_driver) > - rte_vhost_driver_set_features(file, VIRTIO_NET_FEATURES); > + /* Workaround for qemu vhost net device startup */ > + rte_vhost_driver_set_features(file, > + VIRTIO_NET_FEATURES | > + 1ULL << VHOST_USER_F_PROTOCOL_FEATURES); I have taken a closer look. I think it's not really right to just offer this bit like this. Because once this bit is negotiated, QEMU will ask the builtin_net_driver for the protocol features it supports. Currently, there is no API to allow external backends like the builtin_net_driver in this example to set the protocol features it supports, and instead, the protocol features VHOST_USER_PROTOCOL_FEATURES defined in librte_vhost will be returned to QEMU. This will cause problems because the builtin_net_driver doesn't really support those protocol features. > > if (mergeable == 0) { > rte_vhost_driver_disable_features(file, > -- > 2.17.0 >