Skip to contentSkip to conversation

vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE

PATCH Superseded BillXiang 2 participants 8 messages Jul 18, 2024 – Aug 1, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

BillXiang

author
#0 lore raw

PATCH v2 1/1 vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html
and will send this message only for vq 0.

---
V1[1] -> V2:
- Refrain from appending flags to messages that could
precipitate validation failures upon execution of the vhost_user_read_header function.

[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html

---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-user.c +1 -1
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         return ret;
     }
 
-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {
         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
Signature · 1 line
2.30.0
#1 lore raw

typos in subject do not inspire confidence.

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html

Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.

you mean "should send"?

Quoted 18 lines

---
V1[1] -> V2:
- Refrain from appending flags to messages that could
precipitate validation failures upon execution of the vhost_user_read_header function.

[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html

---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644

hw/virtio/vhost-user.c static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base, · line 463

Quoted 5 lines
hw/virtio/vhost-user.c +1 -1
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         return ret;
     }
 
-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {

extra () not needed here.

Quoted 5 lines
hw/virtio/vhost-user.c +0 -0
         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
Signature · 1 line
2.30.0
author
#2 lore raw
Quoted 7 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.

Sorry

Quoted 6 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html

Quoted 8 lines


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?

What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'

Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0

#3 lore raw
Quoted 20 lines · BillXiang
Quoted 7 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.

Sorry

Quoted 10 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?

What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'

do we try to do it now? in which configurations?

Quoted 32 lines
Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0

author
#4 lore raw
Quoted 31 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 16:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 24 lines · BillXiang

Quoted 6 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.


Sorry

Quoted 14 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?

Quoted 8 lines
Quoted 4 lines


What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'



do we try to do it now? in which configurations?

Sorry, I'm not certain about what you're instructing me to do.

Maybe I should merge this patch whit commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") and "[PATCH] vhsot-user: Remove redundant judgment" into one patch.

All of these three patches are aimed to do the same thing as
commit c98ac64cfb53 ("vhost-user: send set log base message only once")
which is not a good solution because there is already a function vhost_user_per_device_request for those messages that should be sent only once per device.

In commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") I added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request so that it will be sent only once per device when 'vq_index == 0'.
After that we should remove the check add by commit c98ac64cfb53 ("vhost-user: send set log base message only once") in "[PATCH] vhsot-user: Remove redundant judgment".
And last, in current patch "vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE" we should only read reply when 'vq_index == 0'.

Quoted 33 lines

Quoted 32 lines
Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0

#5 lore raw
Quoted 35 lines · BillXiang
Quoted 35 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 16:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 28 lines · BillXiang

Quoted 6 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.


Sorry

Quoted 6 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html

Quoted 8 lines


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?


What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'

Quoted 6 lines
Quoted 4 lines



do we try to do it now? in which configurations?

Sorry, I'm not certain about what you're instructing me to do.

I am asking that commit log is structured like this:

currently, abc happens, as a result, def happens
do hij, such that klm instead

Quoted 50 lines

Maybe I should merge this patch whit commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") and "[PATCH] vhsot-user: Remove redundant judgment" into one patch.

All of these three patches are aimed to do the same thing as
commit c98ac64cfb53 ("vhost-user: send set log base message only once")
which is not a good solution because there is already a function vhost_user_per_device_request for those messages that should be sent only once per device.

In commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") I added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request so that it will be sent only once per device when 'vq_index == 0'.
After that we should remove the check add by commit c98ac64cfb53 ("vhost-user: send set log base message only once") in "[PATCH] vhsot-user: Remove redundant judgment".
And last, in current patch "vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE" we should only read reply when 'vq_index == 0'.

Quoted 33 lines

Quoted 32 lines
Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0

author
#6 lore raw
Quoted 48 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 18:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 35 lines · BillXiang

Quoted 34 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 16:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 28 lines · BillXiang

Quoted 6 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.


Sorry

Quoted 6 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html

Quoted 8 lines


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?


What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'

Quoted 6 lines
Quoted 4 lines



do we try to do it now? in which configurations?


Sorry, I'm not certain about what you're instructing me to do.

Quoted 7 lines



I am asking that commit log is structured like this:

currently, abc happens, as a result, def happens do hij, such that klm instead

Should I merge "[PATCH] vhost-user: Remove redundant judgment" with this patch or just left them separated.

Quoted 52 lines


Quoted 50 lines

Maybe I should merge this patch whit commit 7c211eb078c4
("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests")
 and "[PATCH] vhsot-user: Remove redundant judgment" into one patch.

All of these three patches are aimed to do the same thing as
commit c98ac64cfb53 ("vhost-user: send set log base message only once")
which is not a good solution because there is already a function vhost_user_per_device_request for those messages that should be sent only once per device.

In commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") I added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request so that it will be sent only once per device when 'vq_index == 0'.
After that we should remove the check add by commit c98ac64cfb53 ("vhost-user: send set log base message only once") in "[PATCH] vhsot-user: Remove redundant judgment".
And last, in current patch "vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE" we should only read reply when 'vq_index == 0'.

Quoted 33 lines

Quoted 32 lines
Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0

#7 lore raw
Quoted 56 lines · BillXiang
Quoted 48 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 18:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 35 lines · BillXiang

Quoted 34 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Thu, Aug 1, 2024, 16:26
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>

Quoted 28 lines · BillXiang

Quoted 6 lines

From: "Michael S. Tsirkin"<[email protected]>
Date:  Sun, Jul 21, 2024, 03:01
Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
To: "BillXiang"<[email protected]>
Cc: <[email protected]>
typos in subject do not inspire confidence.


Sorry

Quoted 6 lines

Quoted 4 lines · BillXiang

From: BillXiang <[email protected]>

We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html

Quoted 8 lines


Pls put commit here not ML link:
commit ABCDEFGHIKLM ("subject")

Quoted 1 line

and will send this message only for vq 0.


you mean "should send"?


What I mean is the commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") will cause VHOST_USER_SET_LOG_BASE to be sent only when 'vq_index == 0' in vhost_user_write,
so that we can not use vhost_user_read to get reply when 'vq_index != 0'

Quoted 6 lines
Quoted 4 lines



do we try to do it now? in which configurations?


Sorry, I'm not certain about what you're instructing me to do.

Quoted 7 lines



I am asking that commit log is structured like this:

currently, abc happens, as a result, def happens do hij, such that klm instead

Quoted 2 lines

Should I merge "[PATCH] vhost-user: Remove redundant judgment" with this patch or just left them separated.

if the commit log is the same, you can merge.
if it's different, keep them separate.

Quoted 52 lines
Quoted 52 lines


Quoted 50 lines

Maybe I should merge this patch whit commit 7c211eb078c4
("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests")
 and "[PATCH] vhsot-user: Remove redundant judgment" into one patch.

All of these three patches are aimed to do the same thing as
commit c98ac64cfb53 ("vhost-user: send set log base message only once")
which is not a good solution because there is already a function vhost_user_per_device_request for those messages that should be sent only once per device.

In commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests") I added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request so that it will be sent only once per device when 'vq_index == 0'.
After that we should remove the check add by commit c98ac64cfb53 ("vhost-user: send set log base message only once") in "[PATCH] vhsot-user: Remove redundant judgment".
And last, in current patch "vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE" we should only read reply when 'vq_index == 0'.

Quoted 33 lines

Quoted 32 lines
Quoted 32 lines

Quoted 20 lines

---
V1[1] -> V2:
  - Refrain from appending flags to messages that could precipitate validation failures upon execution of the vhost_user_read_header function.
[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg01923.html
---
  hw/virtio/vhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

hw/virtio/vhost-user.c +0 -0
index 00561daa06..fd12992d15 100644
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
          return ret;
      }
Quoted 3 lines


-    if (shmfd) {
+    if (shmfd && (dev->vq_index == 0)) {


extra () not needed here.

Quoted 5 lines

         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {
--
2.30.0