qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/5] net: spread hub on AioContexts


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 1/5] net: spread hub on AioContexts
Date: Wed, 13 Mar 2013 11:37:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

Il 13/03/2013 03:26, liu ping fan ha scritto:
>>> >> +        qemu_net_queue_append(port->nc.peer->send_queue, &port->nc,
>>> >> +                            QEMU_NET_PACKET_FLAG_NONE, buf, len, NULL);
>>> >> +        event_notifier_set(&port->e);
>> >
>> > Why are the context and the EventNotifier a property of the port, rather
>> > than applicable to the NetClientState?
>> >
> Yes, embed context into NetClientState is more reasonable, but as for
> EventNotifier, considering about if we port tap onto context, the tap
> do not have EventNotifier.
> 

There doesn't even need to be an EventNotifier, instead you can pass the
NetClientState's AioContext to the queue and use a bottom half on the
AioContext.

Furthermore, the bottom half should be completely transparent.  Callers
can keep using qemu_net_queue_flush, qemu_net_queue_flush schedules the
bottom half (perhaps, with an optimization, it only does that if the
queue is not empty), the handler actually performs the flush.

Paolo



reply via email to

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