From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BD62F1077; Thu, 27 Apr 2017 11:46:05 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 27 Apr 2017 02:46:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,383,1488873600"; d="scan'208";a="81348161" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.182]) by orsmga004.jf.intel.com with ESMTP; 27 Apr 2017 02:46:02 -0700 From: Zhiyong Yang To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, ciara.loftus@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org, Zhiyong Yang Date: Thu, 27 Apr 2017 17:41:23 +0800 Message-Id: <1493286083-53632-1-git-send-email-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493274893-40764-1-git-send-email-zhiyong.yang@intel.com> References: <1493274893-40764-1-git-send-email-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] vhost: workaround MQ fails to startup 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: Thu, 27 Apr 2017 09:46:06 -0000 vhost since dpdk17.02 + qemu2.7 and above will cause failures of new connection when negotiating to set MQ. (one queue pair works well). Because there exist some bugs in qemu code when introducing VHOST_USER_PROTOCOL_F_REPLY_ACK to qemu. when dealing with the vhost message VHOST_USER_SET_MEM_TABLE for the second time, qemu indeed doesn't send the messge (The message needs to be sent only once)but still will be waiting for dpdk's reply ack, then, qemu is always freezing. DPDK code indeed works in the right way. The feature VHOST_USER_PROTOCOL_F_REPLY_ACK has to be disabled by default at the dpdk side in order to avoid the feature support of DPDK + qemu at the same time. if doing like that, MQ can works well. Cc: stable@dpdk.org Reported-by: Ciara Loftus Signed-off-by: Zhiyong Yang Tested-by: Ciara Loftus --- changes in V2 1. modify "workaround" instead of "fix" in the title. 2. add a simple comment suggested by yuanhan lib/librte_vhost/vhost_user.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h index 2ba22db..35ebd71 100644 --- a/lib/librte_vhost/vhost_user.h +++ b/lib/librte_vhost/vhost_user.h @@ -49,10 +49,14 @@ #define VHOST_USER_PROTOCOL_F_REPLY_ACK 3 #define VHOST_USER_PROTOCOL_F_NET_MTU 4 +/* + * disable REPLY_ACK feature to workaround the buggy QEMU implementation. + * Proved buggy QEMU includes v2.7 - v2.9. + */ #define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \ (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\ (1ULL << VHOST_USER_PROTOCOL_F_RARP) | \ - (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \ + (0ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \ (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU)) typedef enum VhostUserRequest { -- 2.7.4