From patchwork Tue Jul 24 15:16:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Liu X-Patchwork-Id: 43293 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 405FB1DA4; Tue, 24 Jul 2018 09:31:51 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 34DF6239 for ; Tue, 24 Jul 2018 09:31:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 00:31:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,397,1526367600"; d="scan'208";a="73976253" Received: from dpdk-test32.sh.intel.com ([10.67.119.193]) by fmsmga004.fm.intel.com with ESMTP; 24 Jul 2018 00:31:47 -0700 From: Marvin Liu To: tiwei.bie@intel.com, dev@dpdk.org Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, Marvin Liu Date: Tue, 24 Jul 2018 23:16:49 +0800 Message-Id: <20180724151649.44490-1-yong.liu@intel.com> X-Mailer: git-send-email 2.17.0 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") 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); + rte_vhost_driver_set_features(file, + 1ULL << VHOST_USER_F_PROTOCOL_FEATURES); if (mergeable == 0) { rte_vhost_driver_disable_features(file,