qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: vyasevic@redhat.com, aliguori@amazon.com, qemu-devel@nongnu.org,
	qemu-stable@nongnu.org, stefanha@redhat.com, sf@sfritsch.de
Subject: Re: [Qemu-devel] [PATCH v2 for 2.0] virtio-net: Do not filter VLANs without F_CTRL_VLAN
Date: Wed, 26 Mar 2014 19:07:39 +0800	[thread overview]
Message-ID: <20140326110739.GA645@amosk.info> (raw)
In-Reply-To: <20140326105518.GA7614@redhat.com>

On Wed, Mar 26, 2014 at 12:55:18PM +0200, Michael S. Tsirkin wrote:
> On Wed, Mar 26, 2014 at 06:29:52PM +0800, Amos Kong wrote:
> > From: Stefan Fritsch <sf@sfritsch.de>
> > 
> > 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 <sf@sfritsch.de>
> > Signed-off-by: Amos Kong <akong@redhat.com>
> 
> I think this is also -stable material, isn't it?

Yes, it is.
 
> > ---
> > 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,
> > -- 
> > 1.8.5.3

-- 
			Amos.

  reply	other threads:[~2014-03-26 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 10:29 [Qemu-devel] [PATCH v2 for 2.0] virtio-net: Do not filter VLANs without F_CTRL_VLAN Amos Kong
2014-03-26 10:55 ` Michael S. Tsirkin
2014-03-26 11:07   ` Amos Kong [this message]
2014-03-26 10:55 ` Michael S. Tsirkin
2014-03-26 13:39 ` Vlad Yasevich

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=20140326110739.GA645@amosk.info \
    --to=akong@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=sf@sfritsch.de \
    --cc=stefanha@redhat.com \
    --cc=vyasevic@redhat.com \
    /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).