All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio_net: Enable MSI-X vector for ctrl queue
@ 2021-06-18  7:26 Keiichi Watanabe
  2021-06-18 12:38   ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: Keiichi Watanabe @ 2021-06-18  7:26 UTC (permalink / raw)
  To: netdev
  Cc: chirantan, Michael S . Tsirkin, Jason Wang, David S . Miller,
	virtualization, linux-kernel, Keiichi Watanabe

When we use vhost-user backend on the host, MSI-X vector should be set
so that the vmm can get an irq FD and send it to the backend device
process with vhost-user protocol.
Since whether the vector is set for a queue is determined depending on
the queue has a callback, this commit sets an empty callback for
virtio-net's control queue.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
---
 drivers/net/virtio_net.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 11f722460513..002e3695d4b3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2696,6 +2696,11 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
 	virtnet_free_queues(vi);
 }
 
+static void virtnet_ctrlq_done(struct virtqueue *rvq)
+{
+	/* Do nothing */
+}
+
 /* How large should a single buffer be so a queue full of these can fit at
  * least one full packet?
  * Logic below assumes the mergeable buffer header is used.
@@ -2748,7 +2753,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
 
 	/* Parameters for control virtqueue, if any */
 	if (vi->has_cvq) {
-		callbacks[total_vqs - 1] = NULL;
+		callbacks[total_vqs - 1] = virtnet_ctrlq_done;
 		names[total_vqs - 1] = "control";
 	}
 
-- 
2.32.0.288.g62a8d224e6-goog


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

* Re: [PATCH] virtio_net: Enable MSI-X vector for ctrl queue
  2021-06-18  7:26 [PATCH] virtio_net: Enable MSI-X vector for ctrl queue Keiichi Watanabe
@ 2021-06-18 12:38   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2021-06-18 12:38 UTC (permalink / raw)
  To: Keiichi Watanabe
  Cc: netdev, chirantan, Jason Wang, David S . Miller, virtualization,
	linux-kernel

On Fri, Jun 18, 2021 at 04:26:25PM +0900, Keiichi Watanabe wrote:
> When we use vhost-user backend on the host, MSI-X vector should be set
> so that the vmm can get an irq FD and send it to the backend device
> process with vhost-user protocol.
> Since whether the vector is set for a queue is determined depending on
> the queue has a callback, this commit sets an empty callback for
> virtio-net's control queue.
> 
> Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>

I'm confused by this explanation. If the vmm wants to get
an interrupt it can do so - why change the guest driver?

> ---
>  drivers/net/virtio_net.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 11f722460513..002e3695d4b3 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2696,6 +2696,11 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
>  	virtnet_free_queues(vi);
>  }
>  
> +static void virtnet_ctrlq_done(struct virtqueue *rvq)
> +{
> +	/* Do nothing */
> +}
> +
>  /* How large should a single buffer be so a queue full of these can fit at
>   * least one full packet?
>   * Logic below assumes the mergeable buffer header is used.
> @@ -2748,7 +2753,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
>  
>  	/* Parameters for control virtqueue, if any */
>  	if (vi->has_cvq) {
> -		callbacks[total_vqs - 1] = NULL;
> +		callbacks[total_vqs - 1] = virtnet_ctrlq_done;
>  		names[total_vqs - 1] = "control";
>  	}
>  
> -- 
> 2.32.0.288.g62a8d224e6-goog


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

* Re: [PATCH] virtio_net: Enable MSI-X vector for ctrl queue
@ 2021-06-18 12:38   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2021-06-18 12:38 UTC (permalink / raw)
  To: Keiichi Watanabe
  Cc: chirantan, netdev, linux-kernel, virtualization, David S . Miller

On Fri, Jun 18, 2021 at 04:26:25PM +0900, Keiichi Watanabe wrote:
> When we use vhost-user backend on the host, MSI-X vector should be set
> so that the vmm can get an irq FD and send it to the backend device
> process with vhost-user protocol.
> Since whether the vector is set for a queue is determined depending on
> the queue has a callback, this commit sets an empty callback for
> virtio-net's control queue.
> 
> Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>

I'm confused by this explanation. If the vmm wants to get
an interrupt it can do so - why change the guest driver?

> ---
>  drivers/net/virtio_net.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 11f722460513..002e3695d4b3 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2696,6 +2696,11 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
>  	virtnet_free_queues(vi);
>  }
>  
> +static void virtnet_ctrlq_done(struct virtqueue *rvq)
> +{
> +	/* Do nothing */
> +}
> +
>  /* How large should a single buffer be so a queue full of these can fit at
>   * least one full packet?
>   * Logic below assumes the mergeable buffer header is used.
> @@ -2748,7 +2753,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
>  
>  	/* Parameters for control virtqueue, if any */
>  	if (vi->has_cvq) {
> -		callbacks[total_vqs - 1] = NULL;
> +		callbacks[total_vqs - 1] = virtnet_ctrlq_done;
>  		names[total_vqs - 1] = "control";
>  	}
>  
> -- 
> 2.32.0.288.g62a8d224e6-goog

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH] virtio_net: Enable MSI-X vector for ctrl queue
  2021-06-18 12:38   ` Michael S. Tsirkin
@ 2021-06-21  6:21     ` Jason Wang
  -1 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2021-06-21  6:21 UTC (permalink / raw)
  To: Michael S. Tsirkin, Keiichi Watanabe
  Cc: netdev, chirantan, David S . Miller, virtualization, linux-kernel


在 2021/6/18 下午8:38, Michael S. Tsirkin 写道:
> On Fri, Jun 18, 2021 at 04:26:25PM +0900, Keiichi Watanabe wrote:
>> When we use vhost-user backend on the host, MSI-X vector should be set
>> so that the vmm can get an irq FD and send it to the backend device
>> process with vhost-user protocol.
>> Since whether the vector is set for a queue is determined depending on
>> the queue has a callback, this commit sets an empty callback for
>> virtio-net's control queue.
>>
>> Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
> I'm confused by this explanation. If the vmm wants to get
> an interrupt it can do so - why change the guest driver?


+1, it sounds like a bug in the backend or we probably need more context 
here.

Thanks


>
>> ---
>>   drivers/net/virtio_net.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 11f722460513..002e3695d4b3 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -2696,6 +2696,11 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
>>   	virtnet_free_queues(vi);
>>   }
>>   
>> +static void virtnet_ctrlq_done(struct virtqueue *rvq)
>> +{
>> +	/* Do nothing */
>> +}
>> +
>>   /* How large should a single buffer be so a queue full of these can fit at
>>    * least one full packet?
>>    * Logic below assumes the mergeable buffer header is used.
>> @@ -2748,7 +2753,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
>>   
>>   	/* Parameters for control virtqueue, if any */
>>   	if (vi->has_cvq) {
>> -		callbacks[total_vqs - 1] = NULL;
>> +		callbacks[total_vqs - 1] = virtnet_ctrlq_done;
>>   		names[total_vqs - 1] = "control";
>>   	}
>>   
>> -- 
>> 2.32.0.288.g62a8d224e6-goog


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

* Re: [PATCH] virtio_net: Enable MSI-X vector for ctrl queue
@ 2021-06-21  6:21     ` Jason Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2021-06-21  6:21 UTC (permalink / raw)
  To: Michael S. Tsirkin, Keiichi Watanabe
  Cc: chirantan, netdev, David S . Miller, linux-kernel, virtualization


在 2021/6/18 下午8:38, Michael S. Tsirkin 写道:
> On Fri, Jun 18, 2021 at 04:26:25PM +0900, Keiichi Watanabe wrote:
>> When we use vhost-user backend on the host, MSI-X vector should be set
>> so that the vmm can get an irq FD and send it to the backend device
>> process with vhost-user protocol.
>> Since whether the vector is set for a queue is determined depending on
>> the queue has a callback, this commit sets an empty callback for
>> virtio-net's control queue.
>>
>> Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
> I'm confused by this explanation. If the vmm wants to get
> an interrupt it can do so - why change the guest driver?


+1, it sounds like a bug in the backend or we probably need more context 
here.

Thanks


>
>> ---
>>   drivers/net/virtio_net.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 11f722460513..002e3695d4b3 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -2696,6 +2696,11 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
>>   	virtnet_free_queues(vi);
>>   }
>>   
>> +static void virtnet_ctrlq_done(struct virtqueue *rvq)
>> +{
>> +	/* Do nothing */
>> +}
>> +
>>   /* How large should a single buffer be so a queue full of these can fit at
>>    * least one full packet?
>>    * Logic below assumes the mergeable buffer header is used.
>> @@ -2748,7 +2753,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
>>   
>>   	/* Parameters for control virtqueue, if any */
>>   	if (vi->has_cvq) {
>> -		callbacks[total_vqs - 1] = NULL;
>> +		callbacks[total_vqs - 1] = virtnet_ctrlq_done;
>>   		names[total_vqs - 1] = "control";
>>   	}
>>   
>> -- 
>> 2.32.0.288.g62a8d224e6-goog

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2021-06-21  6:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  7:26 [PATCH] virtio_net: Enable MSI-X vector for ctrl queue Keiichi Watanabe
2021-06-18 12:38 ` Michael S. Tsirkin
2021-06-18 12:38   ` Michael S. Tsirkin
2021-06-21  6:21   ` Jason Wang
2021-06-21  6:21     ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.