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, sf@sfritsch.de, qemu-devel@nongnu.org,
	lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 for 2.0] virtio-net: add vlan receive state to RxFilterInfo
Date: Wed, 26 Mar 2014 18:36:08 +0800	[thread overview]
Message-ID: <20140326103608.GB32046@amosk.info> (raw)
In-Reply-To: <20140326064635.GB12840@redhat.com>

On Wed, Mar 26, 2014 at 08:46:35AM +0200, Michael S. Tsirkin wrote:
> On Wed, Mar 26, 2014 at 08:19:43AM +0800, Amos Kong wrote:
> > Stefan Fritsch just fixed a virtio-net driver bug [1], virtio-net won't
> > filter out VLAN-tagged packets if VIRTIO_NET_F_CTRL_VLAN isn't negotiated.
> 
> Yes but that fix is unfortunately wrong as it tests guest_features
> on reset.
> How about preparing a correct one?
 
I just sent a v2:
[PATCH v2 for 2.0] virtio-net: Do not filter VLANs without F_CTRL_VLAN
 
> > This patch added a new field to @RxFilterInfo to indicate vlan receive
> > state ('normal', 'none', 'all'). If VIRTIO_NET_F_CTRL_VLAN isn't
> > negotiated, vlan receive state will be 'all', then all VLAN-tagged packets
> > will be received by guest.
> > 
> > This patch also fixed a boundary issue in visiting vlan table.
> > 
> > [1] http://lists.nongnu.org/archive/html/qemu-devel/2014-02/msg02604.html
> > 
> > Signed-off-by: Amos Kong <akong@redhat.com>
> > ---
> > V2: don't make vlan-table optional, add a flag to indicate
> >     if vlan table is used by management
> > V3: change the new filed to RxState (mst)
> > V4: fix boundary of vlan mapping (eric)

...

> > +    if (!((1 << VIRTIO_NET_F_CTRL_VLAN) & vdev->guest_features)) {
> > +        info->vlan = RX_STATE_ALL;
> > +    } else if (!info->vlan_table) {
> > +        info->vlan = RX_STATE_NONE;
> > +    } else {
> > +        info->vlan = RX_STATE_NORMAL;
> >      }
> 
> Generally I'm not sure why do we have NONE - for mac
> and unicast too - we could send an empty list instead.
> 
> I'm fine with keeping it as is for now though.

It's only be used at the beginning of init stage, guest driver hasn't
change vlan table. state will be normal if default '0' is added to
vlan table.

> > -    info->vlan_table = int_list;
> >  
> >      /* enable event notification after query */
> >      nc->rxfilter_notify_enabled = 1;
> > diff --git a/qapi-schema.json b/qapi-schema.json
> > index b68cd44..391356f 100644

Thanks, Amos

      reply	other threads:[~2014-03-26 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  0:19 [Qemu-devel] [PATCH v4 for 2.0] virtio-net: add vlan receive state to RxFilterInfo Amos Kong
2014-03-26  1:51 ` Eric Blake
2014-03-26  6:46 ` Michael S. Tsirkin
2014-03-26 10:36   ` Amos Kong [this message]

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=20140326103608.GB32046@amosk.info \
    --to=akong@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sf@sfritsch.de \
    --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).