From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSbZX-0000aZ-51 for qemu-devel@nongnu.org; Tue, 25 Mar 2014 20:20:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSbZR-0003sY-L8 for qemu-devel@nongnu.org; Tue, 25 Mar 2014 20:19:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSbZR-0003sS-D3 for qemu-devel@nongnu.org; Tue, 25 Mar 2014 20:19:53 -0400 Date: Wed, 26 Mar 2014 08:19:49 +0800 From: Amos Kong Message-ID: <20140326001949.GA1979@amosk.info> References: <1395762030-6946-1-git-send-email-akong@redhat.com> <5331ADC1.70803@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <5331ADC1.70803@redhat.com> 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: Eric Blake Cc: vyasevic@redhat.com, mst@redhat.com, sf@sfritsch.de, qemu-devel@nongnu.org, lcapitulino@redhat.com --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 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(-) >=20 > Reviewed-by: Eric Blake >=20 >=20 > > + > > + list =3D NULL; > > + for (i =3D 0; i < MAX_VLAN >> 5; i++) { > > + for (j =3D 0; n->vlans[i] && j < 0x1f; j++) { >=20 > 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? Good catch! it should be 'j <=3D 0x1f' =20 > > - 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 >=20 > --=20 > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >=20 --=20 Amos. --KsGdsel6WgEHnImy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTMh0lAAoJELxSv6I5vP9jzvAP/jsvcRcA2GlWQRBROSjfMn+y XgT3Vwv5m+eeGBnJXsroiuKOzsgskbFmuSJpw9eIZ7BMywGn/4PHuan0AVoQ+zSh olGo8QTQM3XMAll1sSdndTDYlBOFvvCWW5kZ1sdYnAxA/AG/b6RA3YPxfY0gDWvz Tm7kjBeXUf29R8RY6DIkA1I4bXcU0r6Uyr1oE684n+U4wwOW2QmqVJMDk0bUftxp y0ggjWauh/UxhHkuPIJPrp1Y+3U3w7Zx22KK28icWATIZfKpxBV9AHTeZzt+pyw5 U8CNl3Xd6yAdC9BWXIrJSRz4xjfg/Z/G8LHC6ZMyORBP+ctd1xUiIRar9AiaPh7M brxNsAaMegv+LvQ/LmZImQC9b5C7TgfKhPHyKd8xOdBDeeRrK61yHFY1nSsalrfW ac9MGuJYHjUf0D7eDF0AUPPlX4Al0VWnkFRId8x/lE+6e5O/J95PNTbNEiF7EXBr vdJM0jowgCtNy7cEwRC2Hv0x2iI4LjHUzOYHtdhNpxUuPzcVYzttOVEVYSso6oOu fPcuOoRhE/xfQUxRe+bC7BQmRoxY42r/kUyBF3fF6VgY+MWfm3E+45Emc7FnlJDb XhS43BIiKsd9aybhaNkxTr1x6+Ny/DKpIUmlEaO1nGoFEIOYxonpt5DNSmqWgTBG h8QUGzdn6QczEsc6PQ6q =A8Ag -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--