[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for 8.1 v2 5/6] vdpa: move CVQ isolation check to net_init_vh
From: |
Jason Wang |
Subject: |
Re: [PATCH for 8.1 v2 5/6] vdpa: move CVQ isolation check to net_init_vhost_vdpa |
Date: |
Thu, 30 Mar 2023 14:23:35 +0800 |
On Thu, Mar 30, 2023 at 2:20 PM Jason Wang <jasowang@redhat.com> wrote:
>
> On Fri, Mar 24, 2023 at 3:54 AM Eugenio Pérez <eperezma@redhat.com> wrote:
> >
> > Evaluating it at start time instead of initialization time may make the
> > guest capable of dynamically adding or removing migration blockers.
> >
> > Also, moving to initialization reduces the number of ioctls in the
> > migration, reducing failure possibilities.
> >
> > As a drawback we need to check for CVQ isolation twice: one time with no
> > MQ negotiated and another one acking it, as long as the device supports
> > it. This is because Vring ASID / group management is based on vq
> > indexes, but we don't know the index of CVQ before negotiating MQ.
>
> We need to fail if we see a device that can isolate cvq without MQ but
> not with MQ.
>
> >
> > Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> > ---
> > v2: Take out the reset of the device from vhost_vdpa_cvq_is_isolated
> > ---
> > net/vhost-vdpa.c | 194 ++++++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 151 insertions(+), 43 deletions(-)
> >
> > diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> > index 4397c0d4b3..db2c9afcb3 100644
> > --- a/net/vhost-vdpa.c
> > +++ b/net/vhost-vdpa.c
> > @@ -43,6 +43,13 @@ typedef struct VhostVDPAState {
> >
> > /* The device always have SVQ enabled */
> > bool always_svq;
> > +
> > + /* The device can isolate CVQ in its own ASID if MQ is negotiated */
> > + bool cvq_isolated_mq;
> > +
> > + /* The device can isolate CVQ in its own ASID if MQ is not negotiated
> > */
> > + bool cvq_isolated;
>
> As stated above, if we need a device that cvq_isolated_mq^cvq_isolated
> == true, we need to fail. This may reduce the complexity of the code?
>
> Thanks
Since we are the mediation layer, Qemu can alway choose to negotiate
MQ regardless whether or not it is supported by the guest. In this
way, we can have a stable virtqueue index for cvq.
Thanks
- Re: [PATCH for 8.1 v2 2/6] vdpa: add vhost_vdpa_reset_status_fd, (continued)
[PATCH for 8.1 v2 6/6] vdpa: Cache cvq group in VhostVDPAState, Eugenio Pérez, 2023/03/23