[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 for 2.0] virtio-net: Do not filter VLANs with
From: |
Vlad Yasevich |
Subject: |
Re: [Qemu-devel] [PATCH v2 for 2.0] virtio-net: Do not filter VLANs without F_CTRL_VLAN |
Date: |
Wed, 26 Mar 2014 09:39:24 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/26/2014 06:29 AM, Amos Kong wrote:
> From: Stefan Fritsch <address@hidden>
>
> If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all
> VLAN-tagged packets but send them to the guest.
>
> This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because
> the OpenBSD driver started as a port from NetBSD).
>
> Signed-off-by: Stefan Fritsch <address@hidden>
> Signed-off-by: Amos Kong <address@hidden>
> ---
> V2: it's not good to check guest features at reset time,
> so reset vlan table in setting features
> ---
> hw/net/virtio-net.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 43b4eda..439477b 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -530,6 +530,12 @@ static void virtio_net_set_features(VirtIODevice *vdev,
> uint32_t features)
> }
> vhost_net_ack_features(tap_get_vhost_net(nc->peer), features);
> }
> +
> + if ((1 << VIRTIO_NET_F_CTRL_VLAN) & features) {
> + memset(n->vlans, 0, MAX_VLAN >> 3);
> + } else {
> + memset(n->vlans, 0xff, MAX_VLAN >> 3);
> + }
> }
>
> static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd,
>
Reviewed-by: Vlad Yasevich <address@hidden>
-vlad