On Wed, Mar 22, 2023 at 3:27 PM Stefano Garzarella <sgarzare@redhat.com> wrote:
On Fri, Mar 17, 2023 at 03:55:41PM +0100, Eugenio Pérez 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.
>
>Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
>---
> net/vhost-vdpa.c | 200 +++++++++++++++++++++++++++++++++++++----------
> 1 file changed, 157 insertions(+), 43 deletions(-)
>
>diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
>index 4397c0d4b3..818a24fb0e 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;
>+
I am not familiar with how CVQ works, so my question might be trivial
;-) but why do we need to have 2 variables depending on F_MQ?
You're right, it is not specified anywhere in the series.
Vring ASID / group management is based on vq indexes. CVQ is always
the last queue, but its position depends on MQ. If it is not acked,
cvq will always be queue #2. if it is acked, it will be
net_config->max_virtqueue_pairs*2.
Previously this was done at device start, so we always know if mq has
been acked or not. But now we are moving to initialization, so we need
to probe both configurations.
Is that clearer now? I'll add to the patch description for sure.