From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkC3O-0007nX-8p for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkC3M-0005XI-9t for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:38:58 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:37228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkC3M-0005X3-34 for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:38:56 -0400 Received: by mail-wg0-f52.google.com with SMTP id z12so583530wgg.7 for ; Wed, 05 Jun 2013 04:38:55 -0700 (PDT) Date: Wed, 5 Jun 2013 13:38:52 +0200 From: Stefan Hajnoczi Message-ID: <20130605113852.GF30326@stefanha-thinkpad.muc.redhat.com> References: <1370412828-15960-1-git-send-email-akong@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370412828-15960-1-git-send-email-akong@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio-net: fix wrong size of vlan filter table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: alex.williamson@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On Wed, Jun 05, 2013 at 02:13:48PM +0800, Amos Kong wrote: > The MAX_VLAN is 4096, currently the vlan filter table has 512 > (4096 >> 3) entries, it's wrong. > > One entry in vlan filter table can indicate 32(1 << 5) vlans, > so the table should have 128 (4096 >> 5) entries. > > Signed-off-by: Amos Kong > --- > btw, it would be simple to use an uint32 number to indicate > all vlans (same as igbvf). I found e1000 uses the same table. > Nothing needs to change here, it would cause migration issue. > --- > hw/net/virtio-net.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) I don't understand this patch. memset() and qemu_put_buffer() work in bytes, therefore MAX_VLAN >> 3. MAX_VLAN >> 3 == MAX_VLAN / BITS_PER_BYTE MAX_VLAN >> 5 == MAX_VLAN / (sizeof(uint32_t) * BITS_PER_BYTE) What bug are you trying to fix?