Re: [PATCH vfio 11/13] vfio/mlx5: Introduce multiple loads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 06, 2022 at 07:46:28PM +0200, Yishai Hadas wrote:

> +start_over:
>  	if (migf->allocated_length < requested_length) {
> -		done = mlx5vf_add_migration_pages(
> +		ret = mlx5vf_add_migration_pages(
>  			migf,
>  			DIV_ROUND_UP(requested_length - migf->allocated_length,
>  				     PAGE_SIZE), &migf->table);
> -		if (done)
> +		if (ret)
> +			goto out_unlock;
> +	}

This really wants to be coded as a state machine, not a tangle of
gotos

> +
> +	if (VFIO_PRE_COPY_SUPP(migf->mvdev)) {
> +		if (!migf->header_read)
> +			mlx5vf_recv_sw_header(migf, pos, &buf, &len, &done);
> +		if (done < 0)
>  			goto out_unlock;

And when you make it into a FSM then we can pre-allocate the required
sg_table space based on the header instead of having to stream

Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux