DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: add device reset status
@ 2020-08-06 11:34 Chenbo Xia
  2020-08-06 11:58 ` Adrian Moreno
  2020-08-10 13:11 ` [dpdk-dev] [PATCH v2] " Chenbo Xia
  0 siblings, 2 replies; 7+ messages in thread
From: Chenbo Xia @ 2020-08-06 11:34 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, zhihong.wang, amorenoz

vhost lib now does not have definition of reset status. This patch
adds the reset status definiton and changes related log.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 632f66d53..73a1ed889 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -239,6 +239,7 @@ struct vhost_virtqueue {
 } __rte_cache_aligned;
 
 /* Virtio device status as per Virtio specification */
+#define VIRTIO_DEVICE_STATUS_RESET		0x00
 #define VIRTIO_DEVICE_STATUS_ACK		0x01
 #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
 #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index c3c924fae..1b520ead7 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 	}
 
 	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
+			"\t-RESET: %u\n"
 			"\t-ACKNOWLEDGE: %u\n"
 			"\t-DRIVER: %u\n"
 			"\t-FEATURES_OK: %u\n"
@@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 			"\t-DEVICE_NEED_RESET: %u\n"
 			"\t-FAILED: %u\n",
 			dev->status,
+			!!(dev->status & VIRTIO_DEVICE_STATUS_RESET),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: add device reset status
  2020-08-06 11:34 [dpdk-dev] [PATCH v1] vhost: add device reset status Chenbo Xia
@ 2020-08-06 11:58 ` Adrian Moreno
  2020-08-07  7:42   ` Xia, Chenbo
  2020-08-10 13:11 ` [dpdk-dev] [PATCH v2] " Chenbo Xia
  1 sibling, 1 reply; 7+ messages in thread
From: Adrian Moreno @ 2020-08-06 11:58 UTC (permalink / raw)
  To: Chenbo Xia, dev; +Cc: maxime.coquelin, zhihong.wang



On 8/6/20 1:34 PM, Chenbo Xia wrote:
> vhost lib now does not have definition of reset status. This patch
> adds the reset status definiton and changes related log.
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  lib/librte_vhost/vhost.h      | 1 +
>  lib/librte_vhost/vhost_user.c | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index 632f66d53..73a1ed889 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -239,6 +239,7 @@ struct vhost_virtqueue {
>  } __rte_cache_aligned;
>  
>  /* Virtio device status as per Virtio specification */
> +#define VIRTIO_DEVICE_STATUS_RESET		0x00
>  #define VIRTIO_DEVICE_STATUS_ACK		0x01
>  #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
>  #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index c3c924fae..1b520ead7 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  	}
>  
>  	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
> +			"\t-RESET: %u\n"
>  			"\t-ACKNOWLEDGE: %u\n"
>  			"\t-DRIVER: %u\n"
>  			"\t-FEATURES_OK: %u\n"
> @@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  			"\t-DEVICE_NEED_RESET: %u\n"
>  			"\t-FAILED: %u\n",
>  			dev->status,
> +			!!(dev->status & VIRTIO_DEVICE_STATUS_RESET),

(dev->status & 0) will always be 0, right?
how about (dev->status == VIRTIO_DEVICE_STATUS_RESET)?

>  			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
>  			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
>  			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
> 

-- 
Adrián Moreno


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: add device reset status
  2020-08-06 11:58 ` Adrian Moreno
@ 2020-08-07  7:42   ` Xia, Chenbo
  0 siblings, 0 replies; 7+ messages in thread
From: Xia, Chenbo @ 2020-08-07  7:42 UTC (permalink / raw)
  To: Adrian Moreno, dev; +Cc: maxime.coquelin, Wang, Zhihong

Hi Adrian,

> -----Original Message-----
> From: Adrian Moreno <amorenoz@redhat.com>
> Sent: Thursday, August 6, 2020 7:59 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Wang, Zhihong <zhihong.wang@intel.com>
> Subject: Re: [PATCH v1] vhost: add device reset status
> 
> 
> 
> On 8/6/20 1:34 PM, Chenbo Xia wrote:
> > vhost lib now does not have definition of reset status. This patch
> > adds the reset status definiton and changes related log.
> >
> > Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> > ---
> >  lib/librte_vhost/vhost.h      | 1 +
> >  lib/librte_vhost/vhost_user.c | 2 ++
> >  2 files changed, 3 insertions(+)
> >
> > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> > index 632f66d53..73a1ed889 100644
> > --- a/lib/librte_vhost/vhost.h
> > +++ b/lib/librte_vhost/vhost.h
> > @@ -239,6 +239,7 @@ struct vhost_virtqueue {
> >  } __rte_cache_aligned;
> >
> >  /* Virtio device status as per Virtio specification */
> > +#define VIRTIO_DEVICE_STATUS_RESET		0x00
> >  #define VIRTIO_DEVICE_STATUS_ACK		0x01
> >  #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
> >  #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
> > diff --git a/lib/librte_vhost/vhost_user.c
> b/lib/librte_vhost/vhost_user.c
> > index c3c924fae..1b520ead7 100644
> > --- a/lib/librte_vhost/vhost_user.c
> > +++ b/lib/librte_vhost/vhost_user.c
> > @@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev,
> struct VhostUserMsg *msg,
> >  	}
> >
> >  	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
> > +			"\t-RESET: %u\n"
> >  			"\t-ACKNOWLEDGE: %u\n"
> >  			"\t-DRIVER: %u\n"
> >  			"\t-FEATURES_OK: %u\n"
> > @@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev,
> struct VhostUserMsg *msg,
> >  			"\t-DEVICE_NEED_RESET: %u\n"
> >  			"\t-FAILED: %u\n",
> >  			dev->status,
> > +			!!(dev->status & VIRTIO_DEVICE_STATUS_RESET),
> 
> (dev->status & 0) will always be 0, right?
> how about (dev->status == VIRTIO_DEVICE_STATUS_RESET)?

Yes. Will correct this in v2.

Thanks!
Chenbo

> 
> >  			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
> >  			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
> >  			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
> >
> 
> --
> Adrián Moreno


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2] vhost: add device reset status
  2020-08-06 11:34 [dpdk-dev] [PATCH v1] vhost: add device reset status Chenbo Xia
  2020-08-06 11:58 ` Adrian Moreno
@ 2020-08-10 13:11 ` Chenbo Xia
  2020-08-10 13:18   ` [dpdk-dev] [PATCH v3] " Chenbo Xia
  1 sibling, 1 reply; 7+ messages in thread
From: Chenbo Xia @ 2020-08-10 13:11 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, zhihong.wang, amorenoz

vhost lib now does not have definition of reset status. This patch
adds the reset status definition and changes related log.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 632f66d53..73a1ed889 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -239,6 +239,7 @@ struct vhost_virtqueue {
 } __rte_cache_aligned;
 
 /* Virtio device status as per Virtio specification */
+#define VIRTIO_DEVICE_STATUS_RESET		0x00
 #define VIRTIO_DEVICE_STATUS_ACK		0x01
 #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
 #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index c3c924fae..ede8813ea 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 	}
 
 	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
+			"\t-RESET: %u\n"
 			"\t-ACKNOWLEDGE: %u\n"
 			"\t-DRIVER: %u\n"
 			"\t-FEATURES_OK: %u\n"
@@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 			"\t-DEVICE_NEED_RESET: %u\n"
 			"\t-FAILED: %u\n",
 			dev->status,
+			(dev->status == VIRTIO_CONFIG_STATUS_RESET),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v3] vhost: add device reset status
  2020-08-10 13:11 ` [dpdk-dev] [PATCH v2] " Chenbo Xia
@ 2020-08-10 13:18   ` Chenbo Xia
  2020-09-18  9:38     ` Maxime Coquelin
  2020-09-18 12:28     ` Maxime Coquelin
  0 siblings, 2 replies; 7+ messages in thread
From: Chenbo Xia @ 2020-08-10 13:18 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, zhihong.wang, amorenoz

vhost lib now does not have definition of reset status. This patch
adds the reset status definition and changes related log.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 632f66d53..73a1ed889 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -239,6 +239,7 @@ struct vhost_virtqueue {
 } __rte_cache_aligned;
 
 /* Virtio device status as per Virtio specification */
+#define VIRTIO_DEVICE_STATUS_RESET		0x00
 #define VIRTIO_DEVICE_STATUS_ACK		0x01
 #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
 #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index c3c924fae..501218e19 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 	}
 
 	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
+			"\t-RESET: %u\n"
 			"\t-ACKNOWLEDGE: %u\n"
 			"\t-DRIVER: %u\n"
 			"\t-FEATURES_OK: %u\n"
@@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
 			"\t-DEVICE_NEED_RESET: %u\n"
 			"\t-FAILED: %u\n",
 			dev->status,
+			(dev->status == VIRTIO_DEVICE_STATUS_RESET),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] vhost: add device reset status
  2020-08-10 13:18   ` [dpdk-dev] [PATCH v3] " Chenbo Xia
@ 2020-09-18  9:38     ` Maxime Coquelin
  2020-09-18 12:28     ` Maxime Coquelin
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2020-09-18  9:38 UTC (permalink / raw)
  To: Chenbo Xia, dev; +Cc: zhihong.wang, amorenoz



On 8/10/20 3:18 PM, Chenbo Xia wrote:
> vhost lib now does not have definition of reset status. This patch
> adds the reset status definition and changes related log.
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  lib/librte_vhost/vhost.h      | 1 +
>  lib/librte_vhost/vhost_user.c | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index 632f66d53..73a1ed889 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -239,6 +239,7 @@ struct vhost_virtqueue {
>  } __rte_cache_aligned;
>  
>  /* Virtio device status as per Virtio specification */
> +#define VIRTIO_DEVICE_STATUS_RESET		0x00
>  #define VIRTIO_DEVICE_STATUS_ACK		0x01
>  #define VIRTIO_DEVICE_STATUS_DRIVER		0x02
>  #define VIRTIO_DEVICE_STATUS_DRIVER_OK		0x04
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index c3c924fae..501218e19 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  	}
>  
>  	VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
> +			"\t-RESET: %u\n"
>  			"\t-ACKNOWLEDGE: %u\n"
>  			"\t-DRIVER: %u\n"
>  			"\t-FEATURES_OK: %u\n"
> @@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  			"\t-DEVICE_NEED_RESET: %u\n"
>  			"\t-FAILED: %u\n",
>  			dev->status,
> +			(dev->status == VIRTIO_DEVICE_STATUS_RESET),
>  			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
>  			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
>  			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] vhost: add device reset status
  2020-08-10 13:18   ` [dpdk-dev] [PATCH v3] " Chenbo Xia
  2020-09-18  9:38     ` Maxime Coquelin
@ 2020-09-18 12:28     ` Maxime Coquelin
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2020-09-18 12:28 UTC (permalink / raw)
  To: Chenbo Xia, dev; +Cc: zhihong.wang, amorenoz



On 8/10/20 3:18 PM, Chenbo Xia wrote:
> vhost lib now does not have definition of reset status. This patch
> adds the reset status definition and changes related log.
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  lib/librte_vhost/vhost.h      | 1 +
>  lib/librte_vhost/vhost_user.c | 2 ++
>  2 files changed, 3 insertions(+)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-18 12:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 11:34 [dpdk-dev] [PATCH v1] vhost: add device reset status Chenbo Xia
2020-08-06 11:58 ` Adrian Moreno
2020-08-07  7:42   ` Xia, Chenbo
2020-08-10 13:11 ` [dpdk-dev] [PATCH v2] " Chenbo Xia
2020-08-10 13:18   ` [dpdk-dev] [PATCH v3] " Chenbo Xia
2020-09-18  9:38     ` Maxime Coquelin
2020-09-18 12:28     ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).