From: Amos Kong <akong@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: vyasevic@redhat.com, mst@redhat.com, sf@sfritsch.de,
qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 for 2.0] virtio-net: add vlan receive state to RxFilterInfo
Date: Wed, 26 Mar 2014 08:19:49 +0800 [thread overview]
Message-ID: <20140326001949.GA1979@amosk.info> (raw)
In-Reply-To: <5331ADC1.70803@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]
On Tue, Mar 25, 2014 at 10:24:33AM -0600, Eric Blake wrote:
> On 03/25/2014 09:40 AM, 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.
> >
> > 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.
> >
> > [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
> > ---
> > hw/net/virtio-net.c | 42 +++++++++++++++++++++++++++++-------------
> > qapi-schema.json | 3 +++
> > qmp-commands.hx | 2 ++
> > 3 files changed, 34 insertions(+), 13 deletions(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
>
> > +
> > + list = NULL;
> > + for (i = 0; i < MAX_VLAN >> 5; i++) {
> > + for (j = 0; n->vlans[i] && j < 0x1f; j++) {
>
> Pre-existing, but isn't this an off-by-one? That is, don't you also
> want the iteration for j==0x1f? Or are there really only 31 instead of
> 32 vlan maps?
Good catch! it should be 'j <= 0x1f'
> > - int_list = NULL;
> > - for (i = 0; i < MAX_VLAN >> 5; i++) {
> > - for (j = 0; n->vlans[i] && j < 0x1f; j++) {
> > - if (n->vlans[i] & (1U << j)) {
> > - int_entry = g_malloc0(sizeof(*int_entry));
> > - int_entry->value = (i << 5) + j;
>
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
--
Amos.
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-03-26 0:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 15:40 [Qemu-devel] [PATCH v3 for 2.0] virtio-net: add vlan receive state to RxFilterInfo Amos Kong
2014-03-25 16:24 ` Eric Blake
2014-03-26 0:19 ` 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=20140326001949.GA1979@amosk.info \
--to=akong@redhat.com \
--cc=eblake@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.