qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Fritsch <sf@sfritsch.de>
Cc: Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>,
	akong@redhat.com
Subject: Re: [Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN
Date: Sun, 16 Feb 2014 12:33:05 +0200	[thread overview]
Message-ID: <20140216103305.GA28991@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402122242370.13560@eru.sfritsch.de>

On Wed, Feb 12, 2014 at 10:46:28PM +0100, Stefan Fritsch wrote:
> If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all
> VLAN-tagged packets but send them to the guest.
> 
> Signed-off-by: Stefan Fritsch <sf@sfritsch.de>

Thanks for the patch.
I think there are still some issues after this
patch: we need to notify management when
this bit state changes.
And I think libvirt still does not look at the filter info
so it's probably not too late, and cleaner to simply tell it:
"all-vlans".
that is, add
    '*vlan':          'RxState',
to the schema.

(is it true that it needs to be * because old qemu does not produce it?
 maybe not ...)

Taking all this into account - this calls for checking
this bit in receive_filter like we do for e.g.
unicast addresses.

Amos, you wrote
commit b1be42803b31a913bab65bab563a8760ad2e7f7f
Author: Amos Kong <akong@redhat.com>
Date:   Fri Jun 14 15:45:52 2013 +0800

    net: add support of mac-programming over macvtap in QEMU side
which conflicts here - could you take a look please?

Also Cc schema maintainers.

> ---
> 
> This time CCing the maintainers.
> 
> This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because
> the OpenBSD driver started as a port from NetBSD).
> 
> 
>  hw/net/virtio-net.c |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 3626608..0ae9a91 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -315,7 +315,11 @@ static void virtio_net_reset(VirtIODevice *vdev)
>      memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
>      memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac));
>      qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
> -    memset(n->vlans, 0, MAX_VLAN >> 3);
> +    if (vdev->guest_features & (1 << VIRTIO_NET_F_CTRL_VLAN)) {
> +        memset(n->vlans, 0, MAX_VLAN >> 3);
> +    } else {
> +        memset(n->vlans, 0xff, MAX_VLAN >> 3);
> +    }
>  }
>  
>  static void peer_test_vnet_hdr(VirtIONet *n)

This chunk doesn't make sense to me.
features are never set at reset, are they?

> @@ -515,6 +519,12 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint32_t features)
>          }
>          vhost_net_ack_features(tap_get_vhost_net(nc->peer), features);
>      }
> +
> +    if (vdev->guest_features & (1 << VIRTIO_NET_F_CTRL_VLAN)) {
> +        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,
> -- 
> 1.7.10.4

  reply	other threads:[~2014-02-16 10:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 21:06 [Qemu-devel] virtio-net VLAN filtering bug Stefan Fritsch
2014-02-12 21:46 ` [Qemu-devel] [PATCH] virtio-net: Do not filter VLANs without F_CTRL_VLAN Stefan Fritsch
2014-02-16 10:33   ` Michael S. Tsirkin [this message]
2014-02-17 14:57     ` Eric Blake
2014-02-17 21:31     ` Stefan Fritsch
2014-02-21  9:58   ` Amos Kong
2014-02-23  8:27     ` Stefan Fritsch
2014-02-25  3:06       ` Amos Kong
2014-03-19 22:38         ` Stefan Fritsch
2014-03-25  9:39           ` Amos Kong
2014-03-25 10:08             ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140216103305.GA28991@redhat.com \
    --to=mst@redhat.com \
    --cc=akong@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sf@sfritsch.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).