From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSUe5-0002JL-GR for qemu-devel@nongnu.org; Tue, 25 Mar 2014 12:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSU9W-0001Bl-JB for qemu-devel@nongnu.org; Tue, 25 Mar 2014 12:28:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSU9W-0001BV-AM for qemu-devel@nongnu.org; Tue, 25 Mar 2014 12:24:38 -0400 Message-ID: <5331ADC1.70803@redhat.com> Date: Tue, 25 Mar 2014 10:24:33 -0600 From: Eric Blake MIME-Version: 1.0 References: <1395762030-6946-1-git-send-email-akong@redhat.com> In-Reply-To: <1395762030-6946-1-git-send-email-akong@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OmkRSrE1onjvRd2m6hKgi3FjkHr1BMl2j" Subject: Re: [Qemu-devel] [PATCH v3 for 2.0] virtio-net: add vlan receive state to RxFilterInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong , qemu-devel@nongnu.org Cc: vyasevic@redhat.com, mst@redhat.com, sf@sfritsch.de, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OmkRSrE1onjvRd2m6hKgi3FjkHr1BMl2j Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 negotiat= ed. >=20 > 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 pack= ets > will be received by guest. >=20 > [1] http://lists.nongnu.org/archive/html/qemu-devel/2014-02/msg02604.ht= ml >=20 > Signed-off-by: Amos Kong > --- > 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 > + > + list =3D NULL; > + for (i =3D 0; i < MAX_VLAN >> 5; i++) { > + for (j =3D 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=3D=3D0x1f? Or are there really only 31 instead = of 32 vlan maps? > - int_list =3D NULL; > - for (i =3D 0; i < MAX_VLAN >> 5; i++) { > - for (j =3D 0; n->vlans[i] && j < 0x1f; j++) { > - if (n->vlans[i] & (1U << j)) { > - int_entry =3D g_malloc0(sizeof(*int_entry)); > - int_entry->value =3D (i << 5) + j; --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --OmkRSrE1onjvRd2m6hKgi3FjkHr1BMl2j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTMa3BAAoJEKeha0olJ0NqUlAIAIGS3Yz/epkwN1mS8M1u+gbP lpV/UFLdcisuMNLpbFlR1Jbzn89lt7FBI2OcB6/3qpOIJ4oYfFGcFUd9W1uoR/DJ VflsRKLRYxXYfkIJKv9MjS1PJsE0SnMngju8GrXZv9iYJO/ayJ7DmK3Q3F/tW8cY dCD3IsA8hWDi1DrAa/KFhNuJpRXyObghaZwxca7Jddk8Re1PkQtNUQzBZP+aP1cI S5UfD3N25wgA8foS+h4E45NzGf+2LnN1V/odHpbX90YFDiN7KtyF3gEJX0oWV1sR M3HNyE/18LvrCJmx3xqA5yQrLvBbwHhOxjDpk21YcV28BDnJZC8+O5xLG6jcbkM= =aJN4 -----END PGP SIGNATURE----- --OmkRSrE1onjvRd2m6hKgi3FjkHr1BMl2j--