From: Dragos Tatulea via Virtualization <virtualization@lists.linux-foundation.org>
To: "eperezma@redhat.com" <eperezma@redhat.com>
Cc: "xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"mst@redhat.com" <mst@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
Gal Pressman <gal@nvidia.com>
Subject: Re: [PATCH vhost 15/16] vdpa/mlx5: Make iotlb helper functions more generic
Date: Thu, 5 Oct 2023 12:16:58 +0000 [thread overview]
Message-ID: <2f11f0c6744e40fe36b5a7429ceb7c88f0e8c91d.camel@nvidia.com> (raw)
In-Reply-To: <CAJaqyWe2btM+8Hbnq9ROyh-bhQA5vVwNk9xgSHb_gFme9dJViw@mail.gmail.com>
On Thu, 2023-10-05 at 12:14 +0200, Eugenio Perez Martin wrote:
> On Thu, Sep 28, 2023 at 6:50 PM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> >
> > They will be used in a followup patch.
> >
> > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > ---
> > drivers/vdpa/mlx5/core/mr.c | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c
> > index 3dee6d9bed6b..a4135c16b5bf 100644
> > --- a/drivers/vdpa/mlx5/core/mr.c
> > +++ b/drivers/vdpa/mlx5/core/mr.c
> > @@ -454,20 +454,20 @@ static void destroy_dma_mr(struct mlx5_vdpa_dev
> > *mvdev, struct mlx5_vdpa_mr *mr)
> > mlx5_vdpa_destroy_mkey(mvdev, mr->mkey);
> > }
> >
> > -static int dup_iotlb(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *src)
> > +static int dup_iotlb(struct vhost_iotlb *iotlb, struct vhost_iotlb *src)
>
> It would be great to move this patch to vhost/iotlb, especially
> because it can be reused by vdpa_sim. But it can be done on top for
> sure,
>
Ack. Will create a separate patch for this after the series.
Thanks,
Dragos
> Acked-by: Eugenio Pérez <eperezma@redhat.com>
>
> > {
> > struct vhost_iotlb_map *map;
> > u64 start = 0, last = ULLONG_MAX;
> > int err;
> >
> > if (!src) {
> > - err = vhost_iotlb_add_range(mvdev->cvq.iotlb, start, last,
> > start, VHOST_ACCESS_RW);
> > + err = vhost_iotlb_add_range(iotlb, start, last, start,
> > VHOST_ACCESS_RW);
> > return err;
> > }
> >
> > for (map = vhost_iotlb_itree_first(src, start, last); map;
> > map = vhost_iotlb_itree_next(map, start, last)) {
> > - err = vhost_iotlb_add_range(mvdev->cvq.iotlb, map->start,
> > map->last,
> > + err = vhost_iotlb_add_range(iotlb, map->start, map->last,
> > map->addr, map->perm);
> > if (err)
> > return err;
> > @@ -475,9 +475,9 @@ static int dup_iotlb(struct mlx5_vdpa_dev *mvdev, struct
> > vhost_iotlb *src)
> > return 0;
> > }
> >
> > -static void prune_iotlb(struct mlx5_vdpa_dev *mvdev)
> > +static void prune_iotlb(struct vhost_iotlb *iotlb)
> > {
> > - vhost_iotlb_del_range(mvdev->cvq.iotlb, 0, ULLONG_MAX);
> > + vhost_iotlb_del_range(iotlb, 0, ULLONG_MAX);
> > }
> >
> > static void destroy_user_mr(struct mlx5_vdpa_dev *mvdev, struct
> > mlx5_vdpa_mr *mr)
> > @@ -544,7 +544,7 @@ void mlx5_vdpa_destroy_mr_resources(struct mlx5_vdpa_dev
> > *mvdev)
> > for (int i = 0; i < MLX5_VDPA_NUM_AS; i++)
> > mlx5_vdpa_destroy_mr(mvdev, mvdev->mr[i]);
> >
> > - prune_iotlb(mvdev);
> > + prune_iotlb(mvdev->cvq.iotlb);
> > }
> >
> > static int _mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev,
> > @@ -596,8 +596,8 @@ int mlx5_vdpa_update_cvq_iotlb(struct mlx5_vdpa_dev
> > *mvdev,
> >
> > spin_lock(&mvdev->cvq.iommu_lock);
> >
> > - prune_iotlb(mvdev);
> > - err = dup_iotlb(mvdev, iotlb);
> > + prune_iotlb(mvdev->cvq.iotlb);
> > + err = dup_iotlb(mvdev->cvq.iotlb, iotlb);
> >
> > spin_unlock(&mvdev->cvq.iommu_lock);
> >
> > --
> > 2.41.0
> >
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-10-05 12:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 16:45 [PATCH vhost v2 00/16] vdpa: Add support for vq descriptor mappings Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH mlx5-next 01/16] vdpa/mlx5: Expose descriptor group mkey hw capability Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 02/16] vdpa: introduce dedicated descriptor group for virtqueue Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 03/16] vhost-vdpa: introduce descriptor group backend feature Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 04/16] vhost-vdpa: uAPI to get dedicated descriptor group id Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 05/16] vdpa/mlx5: Create helper function for dma mappings Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 06/16] vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 07/16] vdpa/mlx5: Take cvq iotlb lock during refresh Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 08/16] vdpa/mlx5: Collapse "dvq" mr add/delete functions Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 09/16] vdpa/mlx5: Rename mr destroy functions Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 10/16] vdpa/mlx5: Allow creation/deletion of any given mr struct Dragos Tatulea via Virtualization
2023-10-03 8:11 ` Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 11/16] vdpa/mlx5: Move mr mutex out of " Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 12/16] vdpa/mlx5: Improve mr update flow Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 13/16] vdpa/mlx5: Introduce mr for vq descriptor Dragos Tatulea via Virtualization
[not found] ` <CAJaqyWfgzUYZdib2TtuJBB7qNBCoiqdHGii6w-M7m+bm8tXVhw@mail.gmail.com>
2023-10-05 12:09 ` Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 14/16] vdpa/mlx5: Enable hw support for vq descriptor mapping Dragos Tatulea via Virtualization
[not found] ` <CAJaqyWeRhJNZ8wbpEFARwBBNbE07n4xQdd-RvUoZooCeB4piPA@mail.gmail.com>
2023-10-05 12:16 ` Dragos Tatulea via Virtualization
2023-09-28 16:45 ` [PATCH vhost 15/16] vdpa/mlx5: Make iotlb helper functions more generic Dragos Tatulea via Virtualization
[not found] ` <CAJaqyWe2btM+8Hbnq9ROyh-bhQA5vVwNk9xgSHb_gFme9dJViw@mail.gmail.com>
2023-10-05 12:16 ` Dragos Tatulea via Virtualization [this message]
2023-09-28 16:45 ` [PATCH vhost 16/16] vdpa/mlx5: Update cvq iotlb mapping on ASID change Dragos Tatulea via Virtualization
[not found] ` <CAJaqyWe9iYnh_DwZbU4986bSAZ0C1=Y9Th6-vv_ZRTTYwQqhYA@mail.gmail.com>
2023-10-05 13:12 ` Dragos Tatulea via Virtualization
2023-10-02 10:16 ` [PATCH vhost v2 00/16] vdpa: Add support for vq descriptor mappings Leon Romanovsky
2023-10-02 10:16 ` (subset) " Leon Romanovsky
2023-10-05 17:31 ` Michael S. Tsirkin
2023-10-05 17:44 ` Dragos Tatulea via Virtualization
2023-10-05 19:18 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f11f0c6744e40fe36b5a7429ceb7c88f0e8c91d.camel@nvidia.com \
--to=virtualization@lists.linux-foundation.org \
--cc=dtatulea@nvidia.com \
--cc=eperezma@redhat.com \
--cc=gal@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).