diff mbox series

[V2,mlx5-next,08/14] vfio: Add a macro for VFIO_DEVICE_STATE_ERROR

Message ID 20211019105838.227569-9-yishaih@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Add mlx5 live migration driver | expand

Commit Message

Yishai Hadas Oct. 19, 2021, 10:58 a.m. UTC
Add a macro for VFIO_DEVICE_STATE_ERROR to be used to set/check an error
state.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
---
 include/uapi/linux/vfio.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alex Williamson Oct. 19, 2021, 3:48 p.m. UTC | #1
On Tue, 19 Oct 2021 13:58:32 +0300
Yishai Hadas <yishaih@nvidia.com> wrote:

> Add a macro for VFIO_DEVICE_STATE_ERROR to be used to set/check an error
> state.
> 
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> ---
>  include/uapi/linux/vfio.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index 114ffcefe437..6d41a0f011db 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -631,6 +631,8 @@ struct vfio_device_migration_info {
>  	__u64 data_size;
>  };
>  
> +#define VFIO_DEVICE_STATE_ERROR (VFIO_DEVICE_STATE_SAVING | \
> +				 VFIO_DEVICE_STATE_RESUMING)

This should be with the other VFIO_DEVICE_STATE_foo #defines.  I'd
probably put it between _RESUMING and _MASK.  Thanks,

Alex

>  /*
>   * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
>   * which allows direct access to non-MSIX registers which happened to be within
Alex Williamson Oct. 19, 2021, 3:50 p.m. UTC | #2
On Tue, 19 Oct 2021 09:48:20 -0600
Alex Williamson <alex.williamson@redhat.com> wrote:

> On Tue, 19 Oct 2021 13:58:32 +0300
> Yishai Hadas <yishaih@nvidia.com> wrote:
> 
> > Add a macro for VFIO_DEVICE_STATE_ERROR to be used to set/check an error
> > state.
> > 
> > Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> > ---
> >  include/uapi/linux/vfio.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> > index 114ffcefe437..6d41a0f011db 100644
> > --- a/include/uapi/linux/vfio.h
> > +++ b/include/uapi/linux/vfio.h
> > @@ -631,6 +631,8 @@ struct vfio_device_migration_info {
> >  	__u64 data_size;
> >  };
> >  
> > +#define VFIO_DEVICE_STATE_ERROR (VFIO_DEVICE_STATE_SAVING | \
> > +				 VFIO_DEVICE_STATE_RESUMING)  
> 
> This should be with the other VFIO_DEVICE_STATE_foo #defines.  I'd
> probably put it between _RESUMING and _MASK.  Thanks,

This should also update the existing macros that include _SAVING |
_RESUMING.  Thanks,

Alex
Yishai Hadas Oct. 20, 2021, 7:35 a.m. UTC | #3
On 10/19/2021 6:50 PM, Alex Williamson wrote:
> On Tue, 19 Oct 2021 09:48:20 -0600
> Alex Williamson <alex.williamson@redhat.com> wrote:
>
>> On Tue, 19 Oct 2021 13:58:32 +0300
>> Yishai Hadas <yishaih@nvidia.com> wrote:
>>
>>> Add a macro for VFIO_DEVICE_STATE_ERROR to be used to set/check an error
>>> state.
>>>
>>> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
>>> ---
>>>   include/uapi/linux/vfio.h | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
>>> index 114ffcefe437..6d41a0f011db 100644
>>> --- a/include/uapi/linux/vfio.h
>>> +++ b/include/uapi/linux/vfio.h
>>> @@ -631,6 +631,8 @@ struct vfio_device_migration_info {
>>>   	__u64 data_size;
>>>   };
>>>   
>>> +#define VFIO_DEVICE_STATE_ERROR (VFIO_DEVICE_STATE_SAVING | \
>>> +				 VFIO_DEVICE_STATE_RESUMING)
>> This should be with the other VFIO_DEVICE_STATE_foo #defines.  I'd
>> probably put it between _RESUMING and _MASK.  Thanks,
> This should also update the existing macros that include _SAVING |
> _RESUMING.  Thanks,
>
> Alex
>
Sure, will do as part of V3.

Yishai
diff mbox series

Patch

diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 114ffcefe437..6d41a0f011db 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -631,6 +631,8 @@  struct vfio_device_migration_info {
 	__u64 data_size;
 };
 
+#define VFIO_DEVICE_STATE_ERROR (VFIO_DEVICE_STATE_SAVING | \
+				 VFIO_DEVICE_STATE_RESUMING)
 /*
  * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
  * which allows direct access to non-MSIX registers which happened to be within