Patchwork [15/21] virtio-net: replace qemu_sendv_packet_async() with qemu_sendv_packet_async_proxy().

login
register
mail settings
Submitter Yoshiaki Tamura
Date Nov. 25, 2010, 6:06 a.m.
Message ID <1290665220-26478-16-git-send-email-tamura.yoshiaki@lab.ntt.co.jp>
Download mbox | patch
Permalink /patch/72985/
State New
Headers show

Comments

Yoshiaki Tamura - Nov. 25, 2010, 6:06 a.m.
Replace replace qemu_sendv_packet_async() with
qemu_sendv_packet_async_proxy() to let event-tap capture events from
virtio-net.

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
---
 hw/virtio-net.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Michael S. Tsirkin - Nov. 28, 2010, 9:31 a.m.
On Thu, Nov 25, 2010 at 03:06:54PM +0900, Yoshiaki Tamura wrote:
> Replace replace qemu_sendv_packet_async() with
> qemu_sendv_packet_async_proxy() to let event-tap capture events from
> virtio-net.
> 
> Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>

Why does every device need to know about eent tap?
Can qemu_sendv_packet_async just do the right thing instead?

> ---
>  hw/virtio-net.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 1d61f19..8c76346 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -710,8 +710,8 @@ static int32_t virtio_net_flush_tx(VirtIONet *n, VirtQueue *vq)
>              len += hdr_len;
>          }
>  
> -        ret = qemu_sendv_packet_async(&n->nic->nc, out_sg, out_num,
> -                                      virtio_net_tx_complete);
> +        ret = qemu_sendv_packet_async_proxy(&n->nic->nc, out_sg, out_num,
> +                                            virtio_net_tx_complete);
>          if (ret == 0) {
>              virtio_queue_set_notification(n->tx_vq, 0);
>              n->async_tx.elem = elem;
> -- 
> 1.7.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshiaki Tamura - Nov. 28, 2010, 11:43 a.m.
2010/11/28 Michael S. Tsirkin <mst@redhat.com>:
> On Thu, Nov 25, 2010 at 03:06:54PM +0900, Yoshiaki Tamura wrote:
>> Replace replace qemu_sendv_packet_async() with
>> qemu_sendv_packet_async_proxy() to let event-tap capture events from
>> virtio-net.
>>
>> Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
>
> Why does every device need to know about eent tap?
> Can qemu_sendv_packet_async just do the right thing instead?

If we let net layer notify event-tap, devices don't have to know
about event-tap.  Most people want to go to that direction, and I
would follow it in the next spin.

Yoshi

>
>> ---
>>  hw/virtio-net.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
>> index 1d61f19..8c76346 100644
>> --- a/hw/virtio-net.c
>> +++ b/hw/virtio-net.c
>> @@ -710,8 +710,8 @@ static int32_t virtio_net_flush_tx(VirtIONet *n, VirtQueue *vq)
>>              len += hdr_len;
>>          }
>>
>> -        ret = qemu_sendv_packet_async(&n->nic->nc, out_sg, out_num,
>> -                                      virtio_net_tx_complete);
>> +        ret = qemu_sendv_packet_async_proxy(&n->nic->nc, out_sg, out_num,
>> +                                            virtio_net_tx_complete);
>>          if (ret == 0) {
>>              virtio_queue_set_notification(n->tx_vq, 0);
>>              n->async_tx.elem = elem;
>> --
>> 1.7.1.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Patch

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 1d61f19..8c76346 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -710,8 +710,8 @@  static int32_t virtio_net_flush_tx(VirtIONet *n, VirtQueue *vq)
             len += hdr_len;
         }
 
-        ret = qemu_sendv_packet_async(&n->nic->nc, out_sg, out_num,
-                                      virtio_net_tx_complete);
+        ret = qemu_sendv_packet_async_proxy(&n->nic->nc, out_sg, out_num,
+                                            virtio_net_tx_complete);
         if (ret == 0) {
             virtio_queue_set_notification(n->tx_vq, 0);
             n->async_tx.elem = elem;