[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 27/41] virtio-net: abstract vlans operations
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCH 27/41] virtio-net: abstract vlans operations |
Date: |
Wed, 02 Dec 2009 19:53:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
"Michael S. Tsirkin" <address@hidden> wrote:
> On Wed, Dec 02, 2009 at 07:26:30PM +0100, Juan Quintela wrote:
>> "Michael S. Tsirkin" <address@hidden> wrote:
>> > On Wed, Dec 02, 2009 at 01:04:25PM +0100, Juan Quintela wrote:
>> >>
>> >> Signed-off-by: Juan Quintela <address@hidden>
>> >> ---
>> >> hw/virtio-net.c | 21 ++++++++++++++++++---
>> >> 1 files changed, 18 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
>> >> index 97db0d0..cf13e94 100644
>> >> --- a/hw/virtio-net.c
>> >> +++ b/hw/virtio-net.c
>> >> @@ -63,6 +63,21 @@ typedef struct VirtIONet
>> >> * - we could suppress RX interrupt if we were so inclined.
>> >> */
>> >>
>> >> +static void vlan_add(VirtIONet *n, int vid)
>> >> +{
>> >> + n->vlans[vid >> 5] |= (1U << (vid & 0x1f));
>> >> +}
>> >> +
>> >> +static void vlan_del(VirtIONet *n, int vid)
>> >> +{
>> >> + n->vlans[vid >> 5] &= ~(1U << (vid & 0x1f));
>> >> +}
>> >> +
>> >> +static bool vlan_is_set(VirtIONet *n, int vid)
>> >> +{
>> >> + return n->vlans[vid >> 5] & ~(1U << (vid & 0x1f));
>> >
>> > This one looks wrong. Did you check this does not break vlans?
>>
>> I don't know how to use vlans (more than one).
>>
>> Current code is wrong (it is not big<->little endian safe.
>> And it is not trivial to make it correct and work from big/little endian
>> old states.
>
> So migration is broken and you want to fix it, fine,
> but please do not break the feature itself.
> You can't check whether bit "vid"
> is set by doing & ~(1 << vid), can you?
/me stares at it. stares something more.
I am enlighted now!!!
/me put brown paper bag on head.
Fixing in next version, thanks.
>
>> I commented in the cover patch that this needed testing/investigation.
>> How is that supposde to be tested?
>>
>> Later, Juan.
>
> Pass in a packet, see if it makes it in?
I use default networking, and networking works. but I don't have more
than one vlan.
Later, Juan.
- [Qemu-devel] Re: [PATCH 20/41] virtio: abstract test for save/load values, (continued)
- [Qemu-devel] [PATCH 22/41] virtio-net: change tx_timer_active to uint32_t, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 23/41] virtio-net: change mergeable_rx_bufs to uint32_t, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 24/41] virtio-net: use type checking version of qemu_put/get-*, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 25/41] virtio-net: MAC_TABLE_ENTRIES has never been bigger, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 26/41] virtio-net: we know vlans size at compile time, make it static, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 27/41] virtio-net: abstract vlans operations, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 28/41] virtio-net: make vlan operations on uint8_t, not uint32_t, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 29/41] virtio-net: in_use and first_multi only handle unsigned values, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 30/41] virtio-net: use save/load type chek functions for has_vent_hdr, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 32/41] virtio-net: split virtio_net_post_load, Juan Quintela, 2009/12/02