[PATCH] vhsot-user: Remove redundant judgment

BillXiang posted 1 patch 4 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240710074041.85984-1-xiangwencheng@dayudpu.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>
hw/virtio/vhost-user.c | 5 -----
1 file changed, 5 deletions(-)
[PATCH] vhsot-user: Remove redundant judgment
Posted by BillXiang 4 months, 2 weeks ago
From: BillXiang <xiangwencheng@dayudpu.com>

Send only once has been supported in vhost_user_write by vhost_user_per_device_request

Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>
---
 hw/virtio/vhost-user.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 00561daa06..04e3568b7e 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -446,11 +446,6 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         .hdr.size = sizeof(msg.payload.log),
     };
 
-    /* Send only once with first queue pair */
-    if (dev->vq_index != 0) {
-        return 0;
-    }
-
     if (shmfd && log->fd != -1) {
         fds[fd_num++] = log->fd;
     }
-- 
2.30.0
Re: [PATCH] vhsot-user: Remove redundant judgment
Posted by Michael S. Tsirkin 4 months ago
On Wed, Jul 10, 2024 at 03:40:41PM +0800, BillXiang wrote:
> From: BillXiang <xiangwencheng@dayudpu.com>
> 
> Send only once has been supported in vhost_user_write by vhost_user_per_device_request
> 
> Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>

I am confused by all the patches. Is it on top of your
other patch or instead of? Because that one added
the vq index check.
If we are going to check vq index it's likely cleaner to
always check it.

And again, typos do not inspire confidence. How was this tested?

> ---
>  hw/virtio/vhost-user.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index 00561daa06..04e3568b7e 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -446,11 +446,6 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
>          .hdr.size = sizeof(msg.payload.log),
>      };
>  
> -    /* Send only once with first queue pair */
> -    if (dev->vq_index != 0) {
> -        return 0;
> -    }
> -
>      if (shmfd && log->fd != -1) {
>          fds[fd_num++] = log->fd;
>      }
> -- 
> 2.30.0