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 B073642DA6; Thu, 13 Jul 2023 14:47:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B02740DDB; Thu, 13 Jul 2023 14:47:42 +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 0180840DDA for ; Thu, 13 Jul 2023 14:47:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689252460; 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=ZwyWCcuyulrKfJVeipFdumviuU8EsyBZwJYTFo+dXjc=; b=iD63tRDNmBuHGx6IogR1kMpQDBwPiOjpSctBVGKlsqniuSSFCsNWoyJZ2rA6WUjkzJPTYK WtMrksBzvxn6f9Yn0oR6eJ53aCZSSUAJa0oOWJsFBjYz6Kf2hg5q4rI+koZHrSAc1RR9a5 MIyfqxVphy5i3fjP/T7YNxuxJtZe2+M= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-IjBwqgPGNH-dYwuDNWjEnA-1; Thu, 13 Jul 2023 08:47:39 -0400 X-MC-Unique: IjBwqgPGNH-dYwuDNWjEnA-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b70c44b5fdso7057861fa.1 for ; Thu, 13 Jul 2023 05:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689252458; x=1691844458; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZwyWCcuyulrKfJVeipFdumviuU8EsyBZwJYTFo+dXjc=; b=B/79umNqHmV0F2adafcbJiz1dG9NSestMIZ7gXQOgXhc3iQ/FfnwXgBQbDPSsWOLo1 qhNmrTLSeWqSiCtJIL8qUJkCnXZBTe3AJvh4dcJXkSVxeqJAQrmhbqI/Mlr92R+bPNtD eGJmyHZsYFL908TC5yNmh5KJGkPkP75eFhJpuH/bNIK/sWLDbQv0Z2q/EYYjkTpjmuMB qJM6GLDinU1eRVjQl7low0NzF6erSaP24YG/ZzCxTXdvrdRSZ48oIxnJfgavMyNwxEr8 AS7GTa8YkH+q1U3Tkbfe5koMSo1pSwYDPVvuBp71VHxwLxwE1vYifCUdIB0DSXnTe4VS Ytow== X-Gm-Message-State: ABy/qLYU8zhKLrzfrK37xB2jsS3ZFlQ8gTMXBJxtUAcx8G4C6JavFe0j zm0Ffcs0LE7v1mTdNHqvvFE1QSgYg6tCGMVFHTWR3qZMuS+H/sOPr40EBGtTnBCkjXNkGcWtoAZ RPQE= X-Received: by 2002:a2e:3c0c:0:b0:2b6:d137:b61c with SMTP id j12-20020a2e3c0c000000b002b6d137b61cmr1288210lja.39.1689252457836; Thu, 13 Jul 2023 05:47:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlFlbnjKZyC6ftYkzwdfGSENQNG/fWB1VUJJYouS0Zoce1YGO5SWVXQz2VDLtPD3nYHKyr01zA== X-Received: by 2002:a2e:3c0c:0:b0:2b6:d137:b61c with SMTP id j12-20020a2e3c0c000000b002b6d137b61cmr1288202lja.39.1689252457468; Thu, 13 Jul 2023 05:47:37 -0700 (PDT) Received: from [192.168.0.36] ([78.17.184.75]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm17093156wmr.46.2023.07.13.05.47.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:47:36 -0700 (PDT) Message-ID: <911b84f0-3bed-16c0-01c1-ad076f033110@redhat.com> Date: Thu, 13 Jul 2023 13:47:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: Maxime Coquelin , 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> From: Kevin Traynor Subject: Re: [PATCH v2 2/2] vhost: force vIOMMU enablement with VDUSE In-Reply-To: <20230713112905.233306-3-maxime.coquelin@redhat.com> 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: 7bit 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 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 ? > @@ -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); > }