qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 12/12] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF neg


From: Linhaifeng
Subject: Re: [Qemu-devel] [PULL 12/12] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation
Date: Tue, 16 Sep 2014 15:06:54 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0


On 2014/9/15 2:41, Michael S. Tsirkin wrote:
> From: Damjan Marion <address@hidden>
> 
> Header length check should happen only if backend is kernel. For user
> backend there is no reason to reset this bit.
> 
> vhost-user code does not define .has_vnet_hdr_len so
> VIRTIO_NET_F_MRG_RXBUF cannot be negotiated even if both sides
> support it.
> 
> Signed-off-by: Damjan Marion <address@hidden>
> Reviewed-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
>  hw/net/vhost_net.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index b21e7a4..77bb93e 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -163,11 +163,11 @@ struct vhost_net *vhost_net_init(VhostNetOptions 
> *options)
>      if (r < 0) {
>          goto fail;
>      }
> -    if (!qemu_has_vnet_hdr_len(options->net_backend,
> -                               sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
> -        net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
> -    }
>      if (backend_kernel) {
> +        if (!qemu_has_vnet_hdr_len(options->net_backend,
> +                               sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
> +            net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
> +        }
>          if (~net->dev.features & net->dev.backend_features) {
>              fprintf(stderr, "vhost lacks feature mask %" PRIu64
>                     " for backend\n",
> 

why vhost-user code not define .has_vnet_hdr_len? I think vhost-user code 
should define it.

if packet bigger than MTU,this will be a bug?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]