Skip to contentSkip to conversation

vhost: add some log for vhost message VHOST_USER_SET_VRING_BASE

PATCH Superseded Andy Pei 2 participants 6 messages Jan 14, 2022 – Jan 27, 2022

lore
Share & tools
lore

Andy Pei

author
#0 lore raw

PATCH 1/1 vhost: add some log for vhost message VHOST_USER_SET_VRING_BASE

Usually the last avail index and last used index is 0, but for target device of live migration, the last avail index and last used index is not 0. So I think some log is helpful.

---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c +5 -0
index a781346..3cb13fb 100644
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%d last_used_idx:%u last_avail_idx:%u.\n",
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Pei, Andy <[email protected]>
Sent: Friday, January 14, 2022 3:19 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>
Subject: [PATCH] vhost: add some log for vhost message VHOST_USER_SET_VRING_BASE

I suggest the title be:

vhost: add log for VHOST_USER_SET_VRING_BASE

Quoted 4 lines

Usually the last avail index and last used index is 0, but for target device of live migration, the last avail index and last used index is not 0. So I think some log is helpful.

Can simplify to:

This patch adds log for vring related info in handling of vhost message VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

Quoted 11 lines
---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c +0 -0
index a781346..3cb13fb 100644

lib/vhost/vhost_user.c line 977

Quoted 5 lines
lib/vhost/vhost_user.c +2 -0
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%d last_used_idx:%u last_avail_idx:%u.\n",

vring idx:%u

Thanks,
Chenbo

Quoted 8 lines
lib/vhost/vhost_user.c +3 -1
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
--

1.8.3.1

author
#2 lore raw

Hi Chenbo,

Thanks for you reply.
I will send a V2 patch to address it.

-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Friday, January 14, 2022 3:40 PM
To: Pei, Andy <[email protected]>; [email protected]
Subject: RE: [PATCH] vhost: add some log for vhost message VHOST_USER_SET_VRING_BASE

Quoted 7 lines

-----Original Message-----
From: Pei, Andy <[email protected]>
Sent: Friday, January 14, 2022 3:19 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>
Subject: [PATCH] vhost: add some log for vhost message VHOST_USER_SET_VRING_BASE

I suggest the title be:

vhost: add log for VHOST_USER_SET_VRING_BASE

Quoted 4 lines

Usually the last avail index and last used index is 0, but for target device of live migration, the last avail index and last used index is not 0. So I think some log is helpful.

Can simplify to:

This patch adds log for vring related info in handling of vhost message VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

Quoted 11 lines
---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c index renamed from lib/vhost/vhost_user.c +0 -0

a781346..3cb13fb 100644

lib/vhost/vhost_user.c line 977

Quoted 5 lines
lib/vhost/vhost_user.c +2 -0
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%d last_used_idx:%u last_avail_idx:%u.\n",

vring idx:%u

Thanks,
Chenbo

Quoted 8 lines
lib/vhost/vhost_user.c +3 -1
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
--

1.8.3.1

author
#3 lore raw

PATCH v2 1/1 vhost: add log for VHOST_USER_SET_VRING_BASE

In reply to Andy Pei

This patch adds log for vring related info in handling of vhost message VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c +5 -0
index a781346..cd8c7bc 100644
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%u last_used_idx:%u last_avail_idx:%u.\n",
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
Signature · 1 line
1.8.3.1
Reviewed-by on v2 1/1
#4 lore raw

RE: [PATCH v2] vhost: add log for VHOST_USER_SET_VRING_BASE

Quoted 32 lines

-----Original Message-----
From: Pei, Andy <[email protected]>
Sent: Friday, January 14, 2022 3:57 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>
Subject: [PATCH v2] vhost: add log for VHOST_USER_SET_VRING_BASE

This patch adds log for vring related info in handling of vhost message VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c +5 -1
index a781346..cd8c7bc 100644
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%u last_used_idx:%u last_avail_idx:%u.\n",
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
--
Quoted 1 line

1.8.3.1

Applied
#5 lore raw

RE: [PATCH v2] vhost: add log for VHOST_USER_SET_VRING_BASE

In reply to Andy Pei
Quoted 32 lines

-----Original Message-----
From: Pei, Andy <[email protected]>
Sent: Friday, January 14, 2022 3:57 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>
Subject: [PATCH v2] vhost: add log for VHOST_USER_SET_VRING_BASE

This patch adds log for vring related info in handling of vhost message VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

---
 lib/vhost/vhost_user.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/vhost/vhost_user.c +5 -1
index a781346..cd8c7bc 100644
@@ -973,6 +973,11 @@
 		vq->last_avail_idx = msg->payload.state.num;
 	}
 
+	VHOST_LOG_CONFIG(INFO,
+		"vring base idx:%u last_used_idx:%u last_avail_idx:%u.\n",
+		msg->payload.state.index, vq->last_used_idx,
+		vq->last_avail_idx);
+
 	return RTE_VHOST_MSG_RESULT_OK;
 }
 
--
Quoted 1 line

1.8.3.1

Applied to next-virtio/main, thanks.