From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D93AA034F for ; Wed, 13 May 2020 04:08:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C8561C138; Wed, 13 May 2020 04:08:32 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 7153E1BFE6 for ; Wed, 13 May 2020 04:08:29 +0200 (CEST) IronPort-SDR: QK0p+Q7tvSP7P/818ra+mMWBVeE3IMLRfIk8+Ac38dtGXSL68Mo3rQqehjvFwFq4c1EM4cCcS/ 249oSP3KfYIg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 19:08:28 -0700 IronPort-SDR: s1kjvLMjUrCbNxt4K0FhPTkFVWCnQBN+q1uHrA+OcgLQOH0ovWkb9XvluD24Eyib4mksb9/t3z qHyNqNwprjYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,385,1583222400"; d="scan'208";a="286860013" Received: from dpdkxuanding-dev2.sh.intel.com ([10.67.118.152]) by fmsmga004.fm.intel.com with ESMTP; 12 May 2020 19:08:26 -0700 From: Xuan Ding To: qabuild@intel.com Cc: Xuan Ding , stable@dpdk.org Date: Wed, 13 May 2020 02:08:17 +0000 Message-Id: <20200513020817.97312-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [DPDK] vhost: fix zero-copy cannot be enabled X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled. Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time. Cc: stable@dpdk.org Signed-off-by: Xuan Ding --- v2: * Added the description of problem solved in commit log. --- lib/librte_vhost/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index bb8d0d780..0a66ef976 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags) ret = -1; goto out_mutex; } - if (!vsocket->is_server) { + if ((flags & RTE_VHOST_USER_CLIENT) != 0) { VHOST_LOG_CONFIG(ERR, "error: zero copy is incompatible with vhost client mode\n"); ret = -1; -- 2.17.1