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 68808A2F6B for ; Tue, 8 Oct 2019 09:40:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DD5C1C02F; Tue, 8 Oct 2019 09:40:54 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BD5BD1BFDF for ; Tue, 8 Oct 2019 09:40:50 +0200 (CEST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5C6051EF1 for ; Tue, 8 Oct 2019 07:40:49 +0000 (UTC) Received: by mail-wm1-f71.google.com with SMTP id s19so631707wmj.0 for ; Tue, 08 Oct 2019 00:40:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Z/rB84SNPdlIzjAuX9lbrK8x9OFlOjdIxIdueOmaw6U=; b=t8ZFJkL7sTq/jZLQK3Zm17kgEFNw5J3GahhhnYIBkTW2QLkZD+VnwM7VtaZrheTD8V W9KOE8idk36BDfngWeWARSMFtM0M2B57R6KImAa1V1eG3d+6Og8OPZ1sYzzOPpNWFP+m BO+BE5reONtVCXioFms9xEdtuwL7J1OWW8Rn2U4DCZ64y4p/N8YnZ8aJfL+mjIqeARTT 5GyUUHlsqRAUJSLvebkfp7j0NoUSlRV3/ovxxNmRLx+nDYKyxYkm2LFuole4KoEjeWAH 8WDXYyZsCmA9pt9vQkllO1qZdlCv6ZuLt1WUSkRuepYG3l0ety/q+tC278h7thhbdNTH ykOA== X-Gm-Message-State: APjAAAU289eoneETrTFz7XwXXDrJcv81NQaINrz8K3xUsueXdpNutSrq LUxUAtQtMtchxz9Cxheudin+gRt17fHk+pdC/gGMGWhu9X013kByJcwrVS5pwIzEsQondn/Ae0f 2jGZjAGo= X-Received: by 2002:a7b:c631:: with SMTP id p17mr2624931wmk.165.1570520448451; Tue, 08 Oct 2019 00:40:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzK3xdwx7eQ/z9Vy79KQHYRRov01om5ZX+2qwcoCManX1Npxy8zAutIOLGcTVh0NMDquE8/LQ== X-Received: by 2002:a7b:c631:: with SMTP id p17mr2624905wmk.165.1570520448231; Tue, 08 Oct 2019 00:40:48 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([81.0.4.169]) by smtp.gmail.com with ESMTPSA id b186sm2916295wmd.16.2019.10.08.00.40.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2019 00:40:47 -0700 (PDT) To: Tiwei Bie Cc: dev@dpdk.org, zhihong.wang@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org References: <20190927183759.18816-1-amorenoz@redhat.com> <20190927183759.18816-4-amorenoz@redhat.com> <20191008062314.GA25865@___> From: Adrian Moreno Autocrypt: addr=amorenoz@redhat.com; prefer-encrypt=mutual; keydata= mQENBF1syNUBCADQ9dk3fDMxOZ/+OQpmbanpodYxEv8IRtDz8PXw8YX7UyGfozOpLjQ8Fftj ZxuubYNbt2QVbSgviFilFdNWu2eTnN/JaGtfhmTOLPVoakkPHZF8lbgImMoch7L0fH8wN2IM KPxQyPNlX+K9FD5brHsV1lfe1TwAxmhcvLW8yNrVq+9eDIDykxc7tH4exIqXgZroahGxMHKy c8Ti2kJka/t6pDfRaY0J+6J7I1nrn6GXXSMNA45EH8+0N/QlcXhP3rfftnoPeVmpjswzvJqY FNjf/Q5VPLx7RX0Qx+y8mMB2JcChV5Bl7D7x5EUbItj6+Sy7QfOgCtPegk9HS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/hPhH4C3O5gWPOLTW6 ylGxiuER4CdFwQIoAMMslhFA7G+teeOKBq36E+1+zrybI6Xy1UBSlpDK9j4CtTnMQejjuSQb Qhle+l8VroaUHq869wjAhRHHhqmtJKggI+OvzgQpDIwfHIDypb1BuKydi2W6cVYEALUYyCLS dTBDhzj8zR5tPCsga8J7+TclQzkWOiI2C6ZtiWrMsL/Uym3uXk5nsoc7lSj7yLd/MrBRhYfP JQ== Message-ID: <61ebab5f-c91c-16bd-17ce-78800474a522@redhat.com> Date: Tue, 8 Oct 2019 09:40:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20191008062314.GA25865@___> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH v3 3/3] vhost: prevent zero copy mode if iommu is on 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" On 10/8/19 8:23 AM, Tiwei Bie wrote: > 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 ...' OK. I'll add it in the next version. > >> + 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 >> Thanks. -Adrián