From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 92A741B1A8 for ; Fri, 2 Feb 2018 12:33:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 03:33:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,448,1511856000"; d="scan'208";a="171132758" Received: from unknown (HELO dpdk98.sh.intel.com) ([10.67.111.140]) by orsmga004.jf.intel.com with ESMTP; 02 Feb 2018 03:33:51 -0800 From: Zhihong Wang To: dev@dpdk.org Cc: jianfeng.tan@intel.com, tiwei.bie@intel.com, maxime.coquelin@redhat.com, yliu@fridaylinux.org, cunming.liang@intel.com, xiao.w.wang@intel.com, dan.daly@intel.com Date: Fri, 2 Feb 2018 18:28:56 -0500 Message-Id: <1517614137-62926-7-git-send-email-zhihong.wang@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1517614137-62926-1-git-send-email-zhihong.wang@intel.com> References: <1517614137-62926-1-git-send-email-zhihong.wang@intel.com> Subject: [dpdk-dev] [PATCH 6/7] vhost: get callfd before device setup 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: Fri, 02 Feb 2018 11:33:54 -0000 From: Xiao Wang This patch is to make sure device is configured with all needed guest info. According to QEMU vhost message sequence, the real callfd comes just before SET_VRING_ENABLE. Signed-off-by: Xiao Wang --- lib/librte_vhost/vhost_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 05b53fa..3fe1b3d 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1547,7 +1547,8 @@ vhost_user_msg_handler(int vid, int fd) send_vhost_reply(fd, &msg); } - if (!(dev->flags & VIRTIO_DEV_RUNNING) && virtio_is_ready(dev)) { + if (!(dev->flags & VIRTIO_DEV_RUNNING) && virtio_is_ready(dev) + && msg.request.master == VHOST_USER_SET_VRING_ENABLE) { dev->flags |= VIRTIO_DEV_READY; if (!(dev->flags & VIRTIO_DEV_RUNNING)) { -- 2.7.5