[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol
From: |
Juan Quintela |
Subject: |
Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2 |
Date: |
Thu, 16 Feb 2023 16:43:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Avihai Horon <avihaih@nvidia.com> wrote:
Reviewed-by: Juan Quintela <quintela@redhat.com>.
1st comment is a bug, but as you just remove it.
Not that it matters a lot in the end (you are removing v1 on the
following patch).
> @@ -438,7 +445,13 @@ static bool
> vfio_devices_all_running_and_mig_active(VFIOContainer *container)
> return false;
> }
>
> - if (migration->device_state_v1 & VFIO_DEVICE_STATE_V1_RUNNING) {
> + if (!migration->v2 &&
> + migration->device_state_v1 & VFIO_DEVICE_STATE_V1_RUNNING) {
> + continue;
> + }
Are you missing here:
} else {
return false;
}
Or I am missunderstanding the code.
> + if (migration->v2 &&
> + migration->device_state == VFIO_DEVICE_STATE_RUNNING) {
> continue;
> } else {
> return false;
[...]
> +/*
> + * This is an arbitrary size based on migration of mlx5 devices, where
> typically
> + * total device migration size is on the order of 100s of MB. Testing with
> + * larger values, e.g. 128MB and 1GB, did not show a performance improvement.
> + */
> +#define VFIO_MIG_DEFAULT_DATA_BUFFER_SIZE (1 * MiB)
Just in case that it makes a difference. You are using here a 1MB
buffer.
But qemu_file_get_to_fd() uses a 32KB buffer.
> }
> }
>
> +static int vfio_query_stop_copy_size(VFIODevice *vbasedev,
> + uint64_t *stop_copy_size)
> +{
> + uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature) +
> + sizeof(struct
> vfio_device_feature_mig_data_size),
> + sizeof(uint64_t))] = {};
> + struct vfio_device_feature *feature = (struct vfio_device_feature *)buf;
suggestion:
size_t size = DIV_ROUND_UP(sizeof(struct vfio_device_feature) +
sizeof(struct
vfio_device_feature_mig_data_size),
sizeof(uint64_t));
g_autofree struct vfio_device_feature *feature = g_malloc0(size *
sizeof(uint64_t));
I have to reread several times to see what was going on there.
And call it a day?
Later, Juan.
- [PATCH v11 03/11] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support, (continued)
- [PATCH v11 03/11] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support, Avihai Horon, 2023/02/16
- [PATCH v11 01/11] linux-headers: Update to v6.2-rc8, Avihai Horon, 2023/02/16
- [PATCH v11 04/11] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one, Avihai Horon, 2023/02/16
- [PATCH v11 05/11] vfio/migration: Block multiple devices migration, Avihai Horon, 2023/02/16
- [PATCH v11 06/11] vfio/migration: Move migration v1 logic to vfio_migration_init(), Avihai Horon, 2023/02/16
- [PATCH v11 07/11] vfio/migration: Rename functions/structs related to v1 protocol, Avihai Horon, 2023/02/16
- [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2023/02/16
- Re: [PATCH v11 08/11] vfio/migration: Implement VFIO migration protocol v2,
Juan Quintela <=
[PATCH v11 10/11] vfio: Alphabetize migration section of VFIO trace-events file, Avihai Horon, 2023/02/16
[PATCH v11 11/11] docs/devel: Align VFIO migration docs to v2 protocol, Avihai Horon, 2023/02/16
[PATCH v11 09/11] vfio/migration: Remove VFIO migration protocol v1, Avihai Horon, 2023/02/16