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 7395FA2F6B for ; Tue, 8 Oct 2019 08:26:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B5852B86; Tue, 8 Oct 2019 08:26:16 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id A5AE11BFA8; Tue, 8 Oct 2019 08:26:14 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2019 23:26:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,269,1566889200"; d="scan'208";a="183656336" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2019 23:26:12 -0700 Date: Tue, 8 Oct 2019 14:23:14 +0800 From: Tiwei Bie To: Adrian Moreno Cc: dev@dpdk.org, zhihong.wang@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org Message-ID: <20191008062314.GA25865@___> References: <20190927183759.18816-1-amorenoz@redhat.com> <20190927183759.18816-4-amorenoz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190927183759.18816-4-amorenoz@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3 3/3] vhost: prevent zero copy mode if iommu is on 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" On Fri, Sep 27, 2019 at 08:37:59PM +0200, Adrian Moreno wrote: > The simltaneous use of dequeue_zero_copy and IOMMU is problematic. > Not only because IOVA_VA mode is not supported but also because the > potential invalidation of guest pages while the buffers are in use, > is not handled. > > Prevent these two features to be enabled simultaneosly. > > Fixes: 69c90e98f483 ("vhost: enable IOMMU support") > Cc: maxime.coquelin@redhat.com > Cc: stable@dpdk.org > > Signed-off-by: Adrian Moreno > --- > lib/librte_vhost/socket.c | 8 ++++++++ > 1 file changed, 8 insertions(+) Reviewed-by: Tiwei Bie > > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c > index 274988c4d..534a7ffe3 100644 > --- a/lib/librte_vhost/socket.c > +++ b/lib/librte_vhost/socket.c > @@ -871,6 +871,14 @@ rte_vhost_driver_register(const char *path, uint64_t flags) > } > vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY; > > + if (vsocket->dequeue_zero_copy && > + (flags & RTE_VHOST_USER_IOMMU_SUPPORT)) { It's better to add one more space before '(flags ...' > + RTE_LOG(ERR, VHOST_CONFIG, > + "error: enabling dequeue zero copy and IOMMU features " > + "simultaneously is not supported\n"); > + goto out_mutex; > + } > + > /* > * Set the supported features correctly for the builtin vhost-user > * net driver. > -- > 2.21.0 >