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 1EACCA0093; Tue, 19 May 2020 11:25:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07CA01C23E; Tue, 19 May 2020 11:25:43 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5722A1C031 for ; Tue, 19 May 2020 11:25:41 +0200 (CEST) IronPort-SDR: n1dUlfBfTPWpCFTr52SvpZPPlyHhyO9h4fPtCWxr1d7Mj9sbzhWS5+D/yUCIGREbMeAF4a+miH NknCWXhopkmQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 02:25:40 -0700 IronPort-SDR: ooCnFk2SKAK9k8Rtnw943rPmMkFIQbzr4b8vfvKLT63tnjOQfbhEVUH49dM9T0kdfIsd6IAXFu 69PNcPuwVEqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,409,1583222400"; d="scan'208";a="267826696" Received: from dpdkxuanding-dev2.sh.intel.com ([10.67.118.152]) by orsmga006.jf.intel.com with ESMTP; 19 May 2020 02:25:38 -0700 From: Xuan Ding To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, xiaolong.ye@intel.com Cc: dev@dpdk.org, Xuan Ding Date: Tue, 19 May 2020 09:21:08 +0000 Message-Id: <20200519092108.49275-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v3] vhost: fix zero-copy cannot be enabled 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" 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. Fixes: 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode") Signed-off-by: Xuan Ding Acked-by: Xiaolong Ye Tested-by: Yinan Wang --- v3: * Removed Cc to stable and added fixes label. 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