qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-net: fix wrong size of vlan filter table


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] virtio-net: fix wrong size of vlan filter table
Date: Wed, 5 Jun 2013 13:38:52 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> ---
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]