From: Paolo Bonzini <pbonzini@redhat.com>
To: liu ping fan <qemulist@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
mdroth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/5] net: spread hub on AioContexts
Date: Wed, 13 Mar 2013 11:37:22 +0100 [thread overview]
Message-ID: <514056E2.2030804@redhat.com> (raw)
In-Reply-To: <CAJnKYQ=1Gm-7W_-0dqLM3AuiNOjh5JRxGgtQA=58jjW4dbyBYg@mail.gmail.com>
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
next prev parent reply other threads:[~2013-03-13 10:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 2:53 [Qemu-devel] [PATCH v2 0/5] make netlayer re-entrant Liu Ping Fan
2013-03-07 2:53 ` [Qemu-devel] [PATCH v2 1/5] net: spread hub on AioContexts Liu Ping Fan
2013-03-12 8:50 ` Paolo Bonzini
2013-03-13 2:26 ` liu ping fan
2013-03-13 10:37 ` Paolo Bonzini [this message]
2013-03-07 2:53 ` [Qemu-devel] [PATCH v2 2/5] net: hub use lock to protect ports list Liu Ping Fan
2013-03-12 8:56 ` Paolo Bonzini
2013-03-07 2:53 ` [Qemu-devel] [PATCH v2 3/5] net: introduce lock to protect NetQueue Liu Ping Fan
2013-03-07 2:53 ` [Qemu-devel] [PATCH v2 4/5] net: introduce lock to protect NetClientState's peer's access Liu Ping Fan
2013-03-12 8:55 ` Paolo Bonzini
2013-03-13 1:26 ` liu ping fan
2013-03-13 10:39 ` Paolo Bonzini
2013-03-14 2:14 ` liu ping fan
2013-03-07 2:53 ` [Qemu-devel] [PATCH v2 5/5] net: make netclient re-entrant with refcnt Liu Ping Fan
2013-03-12 8:45 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=514056E2.2030804@redhat.com \
--to=pbonzini@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.com \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).