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 B8086A00BE; Wed, 29 Apr 2020 05:03:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CE5D1D735; Wed, 29 Apr 2020 05:03:52 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 498191D734 for ; Wed, 29 Apr 2020 05:03:50 +0200 (CEST) IronPort-SDR: S5FESmUBe8xlSs8YEiI/a6WcVHWNxwX2GzzOefbSKWxReT8WBE35wsKlLDy5F734WWkPyYGaPE G4VS7qu+wtGg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 20:03:49 -0700 IronPort-SDR: uQJkjHgxCcwSJ56lICs9+fzjVTUlBa2BH1Uz/QZwvtdBjAxfN4gciIx/cSxCOOvzDuwV9p8C3L bCT9D97QTWRg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,329,1583222400"; d="scan'208";a="249346666" Received: from dpdk-xuanding-dev2.sh.intel.com ([10.67.118.193]) by fmsmga008.fm.intel.com with ESMTP; 28 Apr 2020 20:03:47 -0700 From: Xuan Ding To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, xiaolong.ye@intel.com Cc: dev@dpdk.org, Xuan Ding Date: Wed, 29 Apr 2020 02:59:46 +0000 Message-Id: <20200429025946.48096-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] vhost: zero_copy incompatible with client mode 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" In server mode, virtio-user inits under the assumption that vhost-user supports a list of features. However, this could be problematic when in_order feature is negotiated but not supported by vhost-user when enables dequeue_zero_copy later. Add handling when vhost-user enables dequeue_zero_copy as client. Signed-off-by: Xuan Ding --- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 7c8012179..bb8d0d780 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -926,6 +926,12 @@ rte_vhost_driver_register(const char *path, uint64_t flags) ret = -1; goto out_mutex; } + if (!vsocket->is_server) { + VHOST_LOG_CONFIG(ERR, + "error: zero copy is incompatible with vhost client mode\n"); + ret = -1; + goto out_mutex; + } vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER); vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER); -- 2.17.1