From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6245742E5F; Thu, 13 Jul 2023 15:42:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1C3040DDB; Thu, 13 Jul 2023 15:42:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 845FA40DDA for ; Thu, 13 Jul 2023 15:42:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689255757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MZd+E320fw6wuQV2I16vHn+n2BsShLJfcZYcvd5AJGE=; b=SjkeKSnO8WT8+6SH5zCJW4AeqYez3JkTUKmIDitw9LqGk8N2pCSGNV5rEYPtW+nX7KjJR5 uWTYRWlPnz5IfKYW7ZTNTfdjb9jIpmjP0yU/apKpsf4FQqIFgifQvtGc8mHBhsnZghtLVn rS8vIZ/XmHG+YloLyjbgaIdqywS3OYg= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-miu1oqUuP9yfUiIZaB8CPw-1; Thu, 13 Jul 2023 09:42:32 -0400 X-MC-Unique: miu1oqUuP9yfUiIZaB8CPw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE5B33815F69; Thu, 13 Jul 2023 13:42:31 +0000 (UTC) Received: from [10.39.208.24] (unknown [10.39.208.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E6AEC478DF; Thu, 13 Jul 2023 13:42:30 +0000 (UTC) Message-ID: Date: Thu, 13 Jul 2023 15:42:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 2/2] vhost: force vIOMMU enablement with VDUSE To: Kevin Traynor , dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, chenbo.xia@intel.com, aconole@redhat.com References: <20230713112905.233306-1-maxime.coquelin@redhat.com> <20230713112905.233306-3-maxime.coquelin@redhat.com> <911b84f0-3bed-16c0-01c1-ad076f033110@redhat.com> From: Maxime Coquelin In-Reply-To: <911b84f0-3bed-16c0-01c1-ad076f033110@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 7/13/23 14:47, Kevin Traynor wrote: > On 13/07/2023 12:29, Maxime Coquelin wrote: >> Unlike Vhost-user, VDUSE requires vIOMMU support. >> This patch ignores whether RTE_VHOST_USER_IOMMU_SUPPORT >> flag is passed at register time to avoid having application >> to pass it for having working VDUSE device creation. >> >> Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction") >> >> Signed-off-by: Maxime Coquelin >> --- >>   lib/vhost/socket.c | 7 +++++-- >>   1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c >> index 57dfe3d2fe..79f2138f60 100644 >> --- a/lib/vhost/socket.c >> +++ b/lib/vhost/socket.c >> @@ -932,7 +932,10 @@ rte_vhost_driver_register(const char *path, >> uint64_t flags) >>       vsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY; >>       vsocket->net_compliant_ol_flags = flags & >> RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS; >>       vsocket->stats_enabled = flags & RTE_VHOST_USER_NET_STATS_ENABLE; >> -    vsocket->iommu_support = flags & RTE_VHOST_USER_IOMMU_SUPPORT; >> +    if (vsocket->is_vduse) >> +        vsocket->iommu_support = true; >> +    else >> +        vsocket->iommu_support = flags & RTE_VHOST_USER_IOMMU_SUPPORT; >>       if (vsocket->async_copy && >>           (flags & (RTE_VHOST_USER_IOMMU_SUPPORT | >                  ^^^ do you need to update this check ? Good catch. Yes, it would be better to replace with vsocket->iommu_support. V3 on its way. Thanks! Maxime >> @@ -986,7 +989,7 @@ rte_vhost_driver_register(const char *path, >> uint64_t flags) >>           vsocket->features &= ~seg_offload_features; >>       } >> -    if (!(flags & RTE_VHOST_USER_IOMMU_SUPPORT)) { >> +    if (!vsocket->iommu_support) { >>           vsocket->supported_features &= ~(1ULL << >> VIRTIO_F_IOMMU_PLATFORM); >>           vsocket->features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); >>       } >