[v2,1/4] net/virtio: add DEVICE_NEEDS_RESET status bit

Message ID 20200804072431.86441-2-amorenoz@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series Add support for GET/SET_STATUS on virtio-user pmd |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Adrian Moreno Aug. 4, 2020, 7:24 a.m. UTC
For the sake of completeness, add the definition of the missing status
bit in accordance with the virtio spec

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
 drivers/net/virtio/virtio_pci.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
  

Comments

Chenbo Xia Aug. 5, 2020, 10:52 a.m. UTC | #1
Hi Adrian,

> -----Original Message-----
> From: Adrian Moreno <amorenoz@redhat.com>
> Sent: Tuesday, August 4, 2020 3:24 PM
> To: dev@dpdk.org
> Cc: Wang, Zhihong <zhihong.wang@intel.com>; Xia, Chenbo
> <chenbo.xia@intel.com>; maxime.coquelin@redhat.com; Adrian Moreno
> <amorenoz@redhat.com>
> Subject: [PATCH v2 1/4] net/virtio: add DEVICE_NEEDS_RESET status bit
> 
> For the sake of completeness, add the definition of the missing status
> bit in accordance with the virtio spec
> 
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
> ---
>  drivers/net/virtio/virtio_pci.h | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_pci.h
> b/drivers/net/virtio/virtio_pci.h
> index 74ed77e33..ab61e911b 100644
> --- a/drivers/net/virtio/virtio_pci.h
> +++ b/drivers/net/virtio/virtio_pci.h
> @@ -57,12 +57,13 @@ struct virtnet_ctl;
>  #define VIRTIO_ID_9P       0x09
> 
>  /* Status byte for guest to report progress. */
> -#define VIRTIO_CONFIG_STATUS_RESET     0x00
> -#define VIRTIO_CONFIG_STATUS_ACK       0x01
> -#define VIRTIO_CONFIG_STATUS_DRIVER    0x02
> -#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04
> -#define VIRTIO_CONFIG_STATUS_FEATURES_OK 0x08
> -#define VIRTIO_CONFIG_STATUS_FAILED    0x80
> +#define VIRTIO_CONFIG_STATUS_RESET		0x00
> +#define VIRTIO_CONFIG_STATUS_ACK		0x01
> +#define VIRTIO_CONFIG_STATUS_DRIVER		0x02
> +#define VIRTIO_CONFIG_STATUS_DRIVER_OK		0x04
> +#define VIRTIO_CONFIG_STATUS_FEATURES_OK	0x08
> +#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET	0x40
> +#define VIRTIO_CONFIG_STATUS_FAILED		0x80
> 
>  /*
>   * Each virtqueue indirect descriptor list must be physically contiguous.

Should we also define RESET(0x00) in vhost lib? I don't see the definition
there. Correct me if I'm wrong.

For this patch:

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

> --
> 2.26.2
  
Adrian Moreno Aug. 5, 2020, 2:07 p.m. UTC | #2
On 8/5/20 12:52 PM, Xia, Chenbo wrote:
> Hi Adrian,
> 
>> -----Original Message-----
>> From: Adrian Moreno <amorenoz@redhat.com>
>> Sent: Tuesday, August 4, 2020 3:24 PM
>> To: dev@dpdk.org
>> Cc: Wang, Zhihong <zhihong.wang@intel.com>; Xia, Chenbo
>> <chenbo.xia@intel.com>; maxime.coquelin@redhat.com; Adrian Moreno
>> <amorenoz@redhat.com>
>> Subject: [PATCH v2 1/4] net/virtio: add DEVICE_NEEDS_RESET status bit
>>
>> For the sake of completeness, add the definition of the missing status
>> bit in accordance with the virtio spec
>>
>> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
>> ---
>>  drivers/net/virtio/virtio_pci.h | 13 +++++++------
>>  1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_pci.h
>> b/drivers/net/virtio/virtio_pci.h
>> index 74ed77e33..ab61e911b 100644
>> --- a/drivers/net/virtio/virtio_pci.h
>> +++ b/drivers/net/virtio/virtio_pci.h
>> @@ -57,12 +57,13 @@ struct virtnet_ctl;
>>  #define VIRTIO_ID_9P       0x09
>>
>>  /* Status byte for guest to report progress. */
>> -#define VIRTIO_CONFIG_STATUS_RESET     0x00
>> -#define VIRTIO_CONFIG_STATUS_ACK       0x01
>> -#define VIRTIO_CONFIG_STATUS_DRIVER    0x02
>> -#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04
>> -#define VIRTIO_CONFIG_STATUS_FEATURES_OK 0x08
>> -#define VIRTIO_CONFIG_STATUS_FAILED    0x80
>> +#define VIRTIO_CONFIG_STATUS_RESET		0x00
>> +#define VIRTIO_CONFIG_STATUS_ACK		0x01
>> +#define VIRTIO_CONFIG_STATUS_DRIVER		0x02
>> +#define VIRTIO_CONFIG_STATUS_DRIVER_OK		0x04
>> +#define VIRTIO_CONFIG_STATUS_FEATURES_OK	0x08
>> +#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET	0x40
>> +#define VIRTIO_CONFIG_STATUS_FAILED		0x80
>>
>>  /*
>>   * Each virtqueue indirect descriptor list must be physically contiguous.
> 
> Should we also define RESET(0x00) in vhost lib? I don't see the definition
> there. Correct me if I'm wrong.
> 
I'll add it in a separate patch if that's OK.

> For this patch:
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> 
>> --
>> 2.26.2
> 

Thanks
  

Patch

diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 74ed77e33..ab61e911b 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -57,12 +57,13 @@  struct virtnet_ctl;
 #define VIRTIO_ID_9P       0x09
 
 /* Status byte for guest to report progress. */
-#define VIRTIO_CONFIG_STATUS_RESET     0x00
-#define VIRTIO_CONFIG_STATUS_ACK       0x01
-#define VIRTIO_CONFIG_STATUS_DRIVER    0x02
-#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04
-#define VIRTIO_CONFIG_STATUS_FEATURES_OK 0x08
-#define VIRTIO_CONFIG_STATUS_FAILED    0x80
+#define VIRTIO_CONFIG_STATUS_RESET		0x00
+#define VIRTIO_CONFIG_STATUS_ACK		0x01
+#define VIRTIO_CONFIG_STATUS_DRIVER		0x02
+#define VIRTIO_CONFIG_STATUS_DRIVER_OK		0x04
+#define VIRTIO_CONFIG_STATUS_FEATURES_OK	0x08
+#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET	0x40
+#define VIRTIO_CONFIG_STATUS_FAILED		0x80
 
 /*
  * Each virtqueue indirect descriptor list must be physically contiguous.