From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3F9DCA04A2
	for <public@inbox.dpdk.org>; Tue, 12 May 2020 11:52:57 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 169F41C1A3;
	Tue, 12 May 2020 11:52:57 +0200 (CEST)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 406CD1C010;
 Tue, 12 May 2020 11:52:54 +0200 (CEST)
IronPort-SDR: z2cWrzFM2n7iuRdJ1vx17mGGiBwgfy4owTKs6oUezb6szphs6DBiKG7ZmZcsJTAd50BCleYk2n
 aP8CT/8UgS4Q==
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 May 2020 02:52:53 -0700
IronPort-SDR: 9BiE+ZiaZY+qxao9ZwNg/Wpiygu9TQ9ZbJuNqKi/Mpi9mXa3mICr+swnxlva5yOPRLd+aPRPtB
 r+/FpEFMXP9Q==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.73,383,1583222400"; d="scan'208";a="437041668"
Received: from dpdkxuanding-dev2.sh.intel.com ([10.67.118.152])
 by orsmga005.jf.intel.com with ESMTP; 12 May 2020 02:52:50 -0700
From: Xuan Ding <xuan.ding@intel.com>
To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, xiaolong.ye@intel.com
Cc: dev@dpdk.org,
	Xuan Ding <xuan.ding@intel.com>,
	stable@dpdk.org
Date: Tue, 12 May 2020 09:51:55 +0000
Message-Id: <20200512095155.98708-1-xuan.ding@intel.com>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-stable] [PATCH] vhost: fix dequeue_zero_zopy cannot be enabled
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

Use flag instead of vsocket->is_server to determine whether vhost is
in client mode. Because vsocket->is_server is not ready yet.

Cc: stable@dpdk.org

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---
 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