virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Dragos Tatulea via Virtualization <virtualization@lists.linux-foundation.org>
To: "jasowang@redhat.com" <jasowang@redhat.com>
Cc: "xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"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>,
	"eperezma@redhat.com" <eperezma@redhat.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct
Date: Sun, 8 Oct 2023 12:04:32 +0000	[thread overview]
Message-ID: <4f9759182636f7bb3cb15bc8b6ec6afbe0d6053d.camel@nvidia.com> (raw)
In-Reply-To: <CACGkMEvZESDuOiX_oOvMUh0YqCWYqvmD3Ve9YEJW3+RXXyvGew@mail.gmail.com>

On Sun, 2023-10-08 at 12:25 +0800, Jason Wang wrote:
> On Tue, Sep 26, 2023 at 3:21 PM Dragos Tatulea <dtatulea@nvidia.com> wrote:
> > 
> > On Tue, 2023-09-26 at 12:44 +0800, Jason Wang wrote:
> > > On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea <dtatulea@nvidia.com>
> > > wrote:
> > > > 
> > > > This patch adapts the mr creation/deletion code to be able to work with
> > > > any given mr struct pointer. All the APIs are adapted to take an extra
> > > > parameter for the mr.
> > > > 
> > > > mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore. The
> > > > check is done in the caller instead (mlx5_set_map).
> > > > 
> > > > This change is needed for a followup patch which will introduce an
> > > > additional mr for the vq descriptor data.
> > > > 
> > > > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > > > ---
> > > 
> > > Thinking of this decoupling I think I have a question.
> > > 
> > > We advertise 2 address spaces and 2 groups. So we actually don't know
> > > for example which address spaces will be used by dvq.
> > > 
> > > And actually we allow the user space to do something like
> > > 
> > > set_group_asid(dvq_group, 0)
> > > set_map(0)
> > > set_group_asid(dvq_group, 1)
> > > set_map(1)
> > > 
> > > I wonder if the decoupling like this patch can work and why.
> > > 
> > This scenario could indeed work. Especially if you look at the 13'th patch
> > [0]
> > where hw support is added. Are you wondering if this should work at all or
> > if it
> > should be blocked?
> 
> It would be great if it can work with the following patches. But at
> least for this patch, it seems not:
> 
> For example, what happens if we switch back to group 0 for dvq?
> 
> set_group_asid(dvq_group, 0)
> set_map(0)
> set_group_asid(dvq_group, 1)
> set_map(1)
> // here we destroy the mr created for asid 0
> set_group_asid(dvq_group, 0)
> 
If by destroy you mean .reset, I think it works: During .reset the mapping in
ASID 0 is reset back to the DMA/pysical map (mlx5_vdpa_create_dma_mr). Am I
missing something?

> Btw, if this is a new issue, I haven't checked whether or not it
> exists before this series (if yes, we can fix on top).

> > 
> > > It looks to me the most easy way is to let each AS be backed by an MR.
> > > Then we don't even need to care about the dvq, cvq.
> > That's what this patch series dowes.
> 
> Good to know this, I will review the series.
> 
I was planning to spin a v3 with Eugenio's suggestions. Should I wait for your
feedback before doing that?

Thanks,
Dragos
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2023-10-08 12:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 13:01 [PATCH 00/16] vdpa: Add support for vq descriptor mappings Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 01/16] vdpa: introduce dedicated descriptor group for virtqueue Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 02/16] vhost-vdpa: introduce descriptor group backend feature Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 03/16] vhost-vdpa: uAPI to get dedicated descriptor group id Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 04/16] vdpa/mlx5: Create helper function for dma mappings Dragos Tatulea via Virtualization
2023-09-26  3:11   ` Jason Wang
2023-09-12 13:01 ` [PATCH 05/16] vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code Dragos Tatulea via Virtualization
2023-09-26  3:28   ` Jason Wang
2023-09-12 13:01 ` [PATCH 06/16] vdpa/mlx5: Take cvq iotlb lock during refresh Dragos Tatulea via Virtualization
2023-09-26  3:33   ` Jason Wang
2023-09-12 13:01 ` [PATCH 07/16] vdpa/mlx5: Collapse "dvq" mr add/delete functions Dragos Tatulea via Virtualization
2023-09-26  3:33   ` Jason Wang
2023-09-12 13:01 ` [PATCH 08/16] vdpa/mlx5: Rename mr destroy functions Dragos Tatulea via Virtualization
2023-09-26  3:34   ` Jason Wang
2023-09-12 13:01 ` [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct Dragos Tatulea via Virtualization
2023-09-26  4:44   ` Jason Wang
2023-09-26  7:21     ` Dragos Tatulea via Virtualization
2023-10-08  4:25       ` Jason Wang
2023-10-08 12:04         ` Dragos Tatulea via Virtualization [this message]
2023-10-09  6:39           ` Jason Wang
2023-10-09  7:06             ` Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 10/16] vdpa/mlx5: Move mr mutex out of " Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 11/16] vdpa/mlx5: Improve mr update flow Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 12/16] vdpa/mlx5: Introduce mr for vq descriptor Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 13/16] vdpa/mlx5: Enable hw support for vq descriptor mapping Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 14/16] vdpa/mlx5: Make iotlb helper functions more generic Dragos Tatulea via Virtualization
2023-09-12 13:01 ` [PATCH 15/16] vdpa/mlx5: Update cvq iotlb mapping on ASID change Dragos Tatulea via Virtualization
     [not found] ` <CAPpAL=w6KeBG5Ur037GNQa=n_fdoUwrFo+ATsFtX9HbWPHZvsg@mail.gmail.com>
     [not found]   ` <CAJaqyWeVjKTPmGWwZ26TgebuzCaN8Z2FmPontHvZauOTQj0brQ@mail.gmail.com>
2023-09-15  6:34     ` [PATCH 00/16] vdpa: Add support for vq descriptor mappings Si-Wei Liu
2023-09-25  7:59 ` Dragos Tatulea via Virtualization
2023-09-26 12:22   ` Si-Wei Liu
2023-09-26 12:37     ` Dragos Tatulea via Virtualization

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=4f9759182636f7bb3cb15bc8b6ec6afbe0d6053d.camel@nvidia.com \
    --to=virtualization@lists.linux-foundation.org \
    --cc=dtatulea@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=saeedm@nvidia.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).