Message ID | 20230331154259.1447831-21-maxime.coquelin@redhat.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Maxime Coquelin |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1EADF42887; Fri, 31 Mar 2023 17:45:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F9CA42FAA; Fri, 31 Mar 2023 17:44:07 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 9996342D55 for <dev@dpdk.org>; Fri, 31 Mar 2023 17:44:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680277445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XuzRDiKDa1X4zYFpy1/4othekXqlcbAxdq6a6Nwk6Q8=; b=ZtUnkI9k6LKGQIqLdBmMLU6O4UDPc0D7OCNQOg/mL2BWqFA65E54R4BR6XHpIOq6kKeMuY ObeGR6+pf5q7AV+lkL67HPBkqcXMk57W2GmuT2Rw8/bKa+DnGz5pxPVckF+tnGl8RutZ2+ xL53THMsDYYu1XuWA3OQnwt1mJ6cikE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-650-6AMvldC5OsC-fmTbEb1yNQ-1; Fri, 31 Mar 2023 11:43:59 -0400 X-MC-Unique: 6AMvldC5OsC-fmTbEb1yNQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6405C280BF67; Fri, 31 Mar 2023 15:43:59 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06F7D2027042; Fri, 31 Mar 2023 15:43:56 +0000 (UTC) From: Maxime Coquelin <maxime.coquelin@redhat.com> To: dev@dpdk.org, david.marchand@redhat.com, chenbo.xia@intel.com, mkp@redhat.com, fbl@redhat.com, jasowang@redhat.com, cunming.liang@intel.com, xieyongji@bytedance.com, echaudro@redhat.com, eperezma@redhat.com, amorenoz@redhat.com Cc: Maxime Coquelin <maxime.coquelin@redhat.com> Subject: [RFC 20/27] vhost: add VDUSE callback for IOTLB entry removal Date: Fri, 31 Mar 2023 17:42:52 +0200 Message-Id: <20230331154259.1447831-21-maxime.coquelin@redhat.com> In-Reply-To: <20230331154259.1447831-1-maxime.coquelin@redhat.com> References: <20230331154259.1447831-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
Add VDUSE support to Vhost library
|
|
Commit Message
Maxime Coquelin
March 31, 2023, 3:42 p.m. UTC
This patch implements the VDUSE callback for IOTLB misses,
where it unmaps the pages from the invalidated IOTLB entry
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/vhost/vduse.c | 7 +++++++
1 file changed, 7 insertions(+)
Comments
Hi Maxime, > -----Original Message----- > From: Maxime Coquelin <maxime.coquelin@redhat.com> > Sent: Friday, March 31, 2023 11:43 PM > To: dev@dpdk.org; david.marchand@redhat.com; Xia, Chenbo > <chenbo.xia@intel.com>; mkp@redhat.com; fbl@redhat.com; > jasowang@redhat.com; Liang, Cunming <cunming.liang@intel.com>; Xie, Yongji > <xieyongji@bytedance.com>; echaudro@redhat.com; eperezma@redhat.com; > amorenoz@redhat.com > Cc: Maxime Coquelin <maxime.coquelin@redhat.com> > Subject: [RFC 20/27] vhost: add VDUSE callback for IOTLB entry removal > > This patch implements the VDUSE callback for IOTLB misses, for IOTLB entry removal? This commit messages seems the same as patch 19. You may want to change it :) Thanks, Chenbo > where it unmaps the pages from the invalidated IOTLB entry > > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> > --- > lib/vhost/vduse.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c > index f46823f589..ff4c9e72f1 100644 > --- a/lib/vhost/vduse.c > +++ b/lib/vhost/vduse.c > @@ -32,6 +32,12 @@ > (1ULL << VIRTIO_F_IN_ORDER) | \ > (1ULL << VIRTIO_F_IOMMU_PLATFORM)) > > +static void > +vduse_iotlb_remove_notify(uint64_t addr, uint64_t offset, uint64_t size) > +{ > + munmap((void *)(uintptr_t)addr, offset + size); > +} > + > static int > vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm > __rte_unused) > { > @@ -89,6 +95,7 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, > uint8_t perm __rte_unuse > > static struct vhost_backend_ops vduse_backend_ops = { > .iotlb_miss = vduse_iotlb_miss, > + .iotlb_remove_notify = vduse_iotlb_remove_notify, > }; > > int > -- > 2.39.2
On 5/9/23 07:32, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin <maxime.coquelin@redhat.com> >> Sent: Friday, March 31, 2023 11:43 PM >> To: dev@dpdk.org; david.marchand@redhat.com; Xia, Chenbo >> <chenbo.xia@intel.com>; mkp@redhat.com; fbl@redhat.com; >> jasowang@redhat.com; Liang, Cunming <cunming.liang@intel.com>; Xie, Yongji >> <xieyongji@bytedance.com>; echaudro@redhat.com; eperezma@redhat.com; >> amorenoz@redhat.com >> Cc: Maxime Coquelin <maxime.coquelin@redhat.com> >> Subject: [RFC 20/27] vhost: add VDUSE callback for IOTLB entry removal >> >> This patch implements the VDUSE callback for IOTLB misses, > > for IOTLB entry removal? This commit messages seems the same as patch 19. > You may want to change it :) I indeed need to rework both patches 19 & 20 commit messages. Thanks for the review, Maxime > Thanks, > Chenbo > >> where it unmaps the pages from the invalidated IOTLB entry >> >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> >> --- >> lib/vhost/vduse.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c >> index f46823f589..ff4c9e72f1 100644 >> --- a/lib/vhost/vduse.c >> +++ b/lib/vhost/vduse.c >> @@ -32,6 +32,12 @@ >> (1ULL << VIRTIO_F_IN_ORDER) | \ >> (1ULL << VIRTIO_F_IOMMU_PLATFORM)) >> >> +static void >> +vduse_iotlb_remove_notify(uint64_t addr, uint64_t offset, uint64_t size) >> +{ >> + munmap((void *)(uintptr_t)addr, offset + size); >> +} >> + >> static int >> vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm >> __rte_unused) >> { >> @@ -89,6 +95,7 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, >> uint8_t perm __rte_unuse >> >> static struct vhost_backend_ops vduse_backend_ops = { >> .iotlb_miss = vduse_iotlb_miss, >> + .iotlb_remove_notify = vduse_iotlb_remove_notify, >> }; >> >> int >> -- >> 2.39.2 >
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c index f46823f589..ff4c9e72f1 100644 --- a/lib/vhost/vduse.c +++ b/lib/vhost/vduse.c @@ -32,6 +32,12 @@ (1ULL << VIRTIO_F_IN_ORDER) | \ (1ULL << VIRTIO_F_IOMMU_PLATFORM)) +static void +vduse_iotlb_remove_notify(uint64_t addr, uint64_t offset, uint64_t size) +{ + munmap((void *)(uintptr_t)addr, offset + size); +} + static int vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm __rte_unused) { @@ -89,6 +95,7 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm __rte_unuse static struct vhost_backend_ops vduse_backend_ops = { .iotlb_miss = vduse_iotlb_miss, + .iotlb_remove_notify = vduse_iotlb_remove_notify, }; int