Skip to contentSkip to conversation

vhost: add device reset status

PATCH Superseded Chenbo Xia 3 participants 7 messages Aug 6, 2020 – Sep 18, 2020

lore
Share & tools
lore

Chenbo Xia

author
#0 lore raw

PATCH 1/1 vhost: add device reset status

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
lib/librte_vhost/vhost_user.c +2 -0
index c3c924fae..1b520ead7 100644
@@ -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),
Signature · 1 line
2.17.1
#1 lore raw
Quoted 34 lines · Chenbo Xia

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
lib/librte_vhost/vhost_user.c +1 -0
index c3c924fae..1b520ead7 100644
@@ -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"

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, · line 2542

Quoted 4 lines
lib/librte_vhost/vhost_user.c +1 -0
@@ -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)?

Quoted 4 lines
lib/librte_vhost/vhost_user.c +0 -0
 			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),
Signature · 1 line
Adrián Moreno
#2 lore raw

Hi Adrian,

Quoted 47 lines

-----Original Message-----
From: Adrian Moreno <[email protected]>
Sent: Thursday, August 6, 2020 7:59 PM
To: Xia, Chenbo <[email protected]>; [email protected]
Cc: [email protected]; Wang, Zhihong <[email protected]>
Subject: Re: [PATCH v1] vhost: add device reset status

Review

Quoted 22 lines · Chenbo Xia

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
(quoted diff) +0 -0

b/lib/librte_vhost/vhost_user.c

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev,

Quoted 4 lines

index c3c924fae..1b520ead7 100644

lib/librte_vhost/vhost_user.c +0 -0
@@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev,

struct VhostUserMsg *msg,

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev,

Quoted 8 lines
lib/librte_vhost/vhost_user.c +1 -0
 	}
 
 	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,

Quoted 7 lines

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, · line 2542

Quoted 4 lines
lib/librte_vhost/vhost_user.c +1 -0
 			"\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

Quoted 8 lines

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, · line 2545

Quoted 5 lines
lib/librte_vhost/vhost_user.c +0 -0
 			!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
 			!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),

--
Adrián Moreno

author
#3 lore raw

PATCH v2 1/1 vhost: add device reset status

In reply to Chenbo Xia

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
lib/librte_vhost/vhost_user.c +2 -0
index c3c924fae..ede8813ea 100644
@@ -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),
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH v3 1/1 vhost: add device reset status

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
lib/librte_vhost/vhost_user.c +2 -0
index c3c924fae..501218e19 100644
@@ -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),
Signature · 1 line
2.17.1
Reviewed-by on v3 1/1
#5 lore raw
Quoted 35 lines · Chenbo Xia

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

---
 lib/librte_vhost/vhost.h      | 1 +
 lib/librte_vhost/vhost_user.c | 2 ++
 2 files changed, 3 insertions(+)
lib/librte_vhost/vhost.h +1 -0
index 632f66d53..73a1ed889 100644
@@ -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
lib/librte_vhost/vhost_user.c +1 -0
index c3c924fae..501218e19 100644
@@ -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"

lib/librte_vhost/vhost_user.c vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, · line 2545

Quoted 7 lines
lib/librte_vhost/vhost_user.c +1 -0
@@ -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),

Thanks,
Maxime

#6 lore raw
In reply to Chenbo Xia
Quoted 8 lines · Chenbo Xia

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

---
 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