RE: [PATCH vfio 2/5] vfio/mlx5: Add support for tracker object events

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

 



> From: Yishai Hadas <yishaih@xxxxxxxxxx>
> Sent: Wednesday, January 31, 2024 1:02 AM
> 
> +static void set_tracker_event(struct mlx5vf_pci_core_device *mvdev)
> +{
> +	mvdev->tracker.event_occur = true;
> +	complete(&mvdev->tracker_comp);

it's slightly clearer to call it 'object_changed'.

> @@ -1634,6 +1671,11 @@ int mlx5vf_tracker_read_and_clear(struct
> vfio_device *vdev, unsigned long iova,
>  		goto end;
>  	}
> 
> +	if (tracker->is_err) {
> +		err = -EIO;
> +		goto end;
> +	}
> +

this sounds like a separate improvement? i.e. if the tracker is already
in an error state then exit early. if yes better put it in a separate patch.

> @@ -1652,6 +1694,12 @@ int mlx5vf_tracker_read_and_clear(struct
> vfio_device *vdev, unsigned long iova,
>  						      dirty, &tracker->status);
>  			if (poll_err == CQ_EMPTY) {
>  				wait_for_completion(&mvdev-
> >tracker_comp);
> +				if (tracker->event_occur) {
> +					tracker->event_occur = false;
> +					err =
> mlx5vf_cmd_query_tracker(mdev, tracker);
> +					if (err)
> +						goto end;
> +				}

this implies that the error notified by tracker event cannot be queried
by mlx5vf_cq_poll_one() otherwise the next iteration will get the error
state anyway. possibly add a comment to clarify.

and why not setting state->is_err too?





[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