[Qemu-devel] [RFC PATCH v3 0/5] port network layer onto glib

2013-04-07 Thread Liu Ping Fan
for tx, one for rx, so vq can run on different threads. 2.make network front-end onto glib, currently virtio net dataplane Liu Ping Fan (5): net: introduce glib function for network net: port tap onto glib net: resolve race of tap backend and its peer net: port vde onto glib net: port

[Qemu-devel] [RFC PATCH v3 4/5] net: port vde onto glib

2013-04-07 Thread Liu Ping Fan
Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- net/vde.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/net/vde.c b/net/vde.c index 4dea32d..be5a032 100644 --- a/net/vde.c +++ b/net/vde.c @@ -60,6 +60,16 @@ static ssize_t vde_receive

Re: [Qemu-devel] [RFC PATCH v2 1/4] net: port tap onto glib

2013-04-03 Thread liu ping fan
On Thu, Mar 28, 2013 at 10:32 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Mar 28, 2013 at 03:55:52PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Bind each NetClientState with a GSource(ie,NetClientSource). Currently, these GSource attached with default

Re: [Qemu-devel] [RFC PATCH v4 00/30] ACPI memory hotplug

2013-04-02 Thread liu ping fan
On Fri, Jan 11, 2013 at 2:57 AM, Vasilis Liaskovitis vasilis.liaskovi...@profitbricks.com wrote: IIRC q35 supports memory hotplug natively (picked up in some discussion). Is that correct? From previous discussion I also understand that q35 supports native hotplug. Sections 5.1 and 5.2

Re: [Qemu-devel] [RFC PATCH v2 0/4] port network layer onto glib

2013-04-02 Thread liu ping fan
On Thu, Mar 28, 2013 at 9:40 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Mar 28, 2013 at 09:42:47AM +0100, Paolo Bonzini wrote: Il 28/03/2013 08:55, Liu Ping Fan ha scritto: 3rd. block layer's AioContext will block other AioContexts on the same thread. I cannot understand

Re: [Qemu-devel] [RFC PATCH v2 0/4] port network layer onto glib

2013-04-01 Thread liu ping fan
On Thu, Mar 28, 2013 at 10:55 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Mar 28, 2013 at 03:55:51PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com These series aim to make the whole network re-entrant, here only apply backend and frontend

[Qemu-devel] [PATCH 0/5] proposal to make hostmem listener RAM unplug safe

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This is an proposal similar to push core listener out of biglock for core listener out of biglock, refer to orignal plan posted by Marcelo Tosatti, http://lists.gnu.org/archive/html/qemu-devel/2012-06/msg04315.html While core

[Qemu-devel] [PATCH 1/5] memory: add ref/unref interface for MemroyRegionOps

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This pair of interface are optinal, except for those device which is used outside the biglock's protection for hot unplug. Currently, HostMem used by virtio-blk dataplane is outside biglock, so the RAM device should implement this. Signed-off

[Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt MemoryRegionOps's ref/unref interface to make it survive the RAM hotunplug. Signed-off-by: Liu Ping Fan pingf

[Qemu-devel] [PATCH 5/5] hostmem: init/finalize hostmem listener

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- vl.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 7643f16..46a25cf 100644 --- a/vl.c +++ b/vl.c @@ -4157,6 +4157,7 @@ int main(int argc, char

[Qemu-devel] [PATCH 3/5] vring: use hostmem's RAM safe api

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com When lookup gpa to hva, the corresponding MemoryRegion will be exposed to caller, and will release by caller later Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/vring.c | 88

[Qemu-devel] [PATCH 4/5] virtio-blk: release reference to RAM's memoryRegion

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com virtio-blk will reference to RAM's memoryRegion when the req has been done. So we can avoid to call bdrv_drain_all() when RAM hot unplug. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/virtio-blk.c | 52

Re: [Qemu-devel] [PATCH] memory: reverse the priority when commit

2013-03-29 Thread liu ping fan
On Thu, Mar 28, 2013 at 10:44 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 28 March 2013 08:08, Liu Ping Fan pingf...@linux.vnet.ibm.com wrote: In theroy, the high priority should commit earlier, it is the same reason as the sequence of Lower = earlier (during add), later (during del

Re: [Qemu-devel] [RFC PATCH v2 2/4] net: resolve race of tap backend and its peer

2013-03-29 Thread liu ping fan
On Thu, Mar 28, 2013 at 10:34 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Mar 28, 2013 at 03:55:53PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- net/tap.c |7 ++- 1 files changed, 6

Re: [Qemu-devel] [RFC PATCH v2 3/4] net: port hub onto glib

2013-03-29 Thread liu ping fan
On Thu, Mar 28, 2013 at 10:47 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Mar 28, 2013 at 03:55:54PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Attach each hubport with a GSource. Currently the GSource is attached to default main context, and the hub

[Qemu-devel] [RFC PATCH v2 0/4] port network layer onto glib

2013-03-28 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com These series aim to make the whole network re-entrant, here only apply backend and frontend, and for the netcore, separated patches have been sent out. All of these will prepare us for moving towards making network layer mutlit-thread. Finally

[Qemu-devel] [RFC PATCH v2 1/4] net: port tap onto glib

2013-03-28 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Bind each NetClientState with a GSource(ie,NetClientSource). Currently, these GSource attached with default context, but in future, after resolving the race between handlers and the interface exposed by NetClientInfo and other re-entrant issue, we

[Qemu-devel] [RFC PATCH v2 2/4] net: resolve race of tap backend and its peer

2013-03-28 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- net/tap.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net/tap.c b/net/tap.c index 0b663d1..401161c 100644 --- a/net/tap.c +++ b/net/tap.c @@ -321,9

[Qemu-devel] [RFC PATCH v2 3/4] net: port hub onto glib

2013-03-28 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Attach each hubport with a GSource. Currently the GSource is attached to default main context, and the hub still run on iothread, but in future, after making the whole layer thread-safe, we will admit ports to run on different thread. Signed-off

[Qemu-devel] [RFC PATCH v2 4/4] net: port virtio net onto glib

2013-03-28 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/virtio-net.c | 165 +++ hw/virtio.c |6 ++ hw/virtio.h |2 + 3 files changed, 173 insertions(+), 0 deletions(-) diff

Re: [Qemu-devel] [RFC PATCH v4 00/30] ACPI memory hotplug

2013-03-28 Thread liu ping fan
On Thu, Mar 28, 2013 at 5:29 PM, Vasilis Liaskovitis vasilis.liaskovi...@profitbricks.com wrote: Hi, [...] I haven't updated the series for a while, but I can rework if there is a more clear direction for the community. Another open issue is reference counting of

[Qemu-devel] [PATCH] memory: reverse the priority when commit

2013-03-28 Thread Liu Ping Fan
In theroy, the high priority should commit earlier, it is the same reason as the sequence of Lower = earlier (during add), later (during del) Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- memory.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/memory.c b

Re: [Qemu-devel] [PATCH 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors

2013-03-27 Thread liu ping fan
On Wed, Mar 27, 2013 at 12:07 AM, Stefan Hajnoczi stefa...@redhat.com wrote: There are several places where QEMU accidentally relies on the O_NONBLOCK state of passed file descriptors. Exposing O_NONBLOCK state makes it part of the QMP If in future, we push more backend on their dedicated

Re: [Qemu-devel] [RFC PATCH 0/2] port network layer onto glib

2013-03-14 Thread liu ping fan
On Wed, Mar 13, 2013 at 6:58 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 13/03/2013 06:59, Liu Ping Fan ha scritto: These series aim to port network backend onto glib, and prepare for moving towards making network layer mutlit-thread. The brief of the whole aim and plan is documented

[Qemu-devel] [RFC PATCH 1/2] net: port tap onto glib

2013-03-13 Thread Liu Ping Fan
Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- include/net/net.h | 21 net/net.c | 89 + net/tap.c | 57 +++-- 3 files changed, 156 insertions(+), 11 deletions(-) diff

[Qemu-devel] [RFC PATCH 2/2] net: port hub onto glib

2013-03-13 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Attach each hubport with a GSource. Currently the GSource is attached to default main context, and the hub still run on iothread, but in future, after making the whole layer thread-safe, we will admit ports to run on different thread(GMainContext

Re: [Qemu-devel] [PATCH v2 4/5] net: introduce lock to protect NetClientState's peer's access

2013-03-13 Thread liu ping fan
On Wed, Mar 13, 2013 at 6:39 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 13/03/2013 02:26, liu ping fan ha scritto: On Tue, Mar 12, 2013 at 4:55 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/03/2013 03:53, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH v2 4/5] net: introduce lock to protect NetClientState's peer's access

2013-03-12 Thread liu ping fan
On Tue, Mar 12, 2013 at 4:55 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/03/2013 03:53, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Introduce nc-send_lock, it shield off the race of nc-peer's reader and deleter. With it, after deleter finish, no new

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

2013-03-12 Thread liu ping fan
On Tue, Mar 12, 2013 at 4:50 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/03/2013 03:53, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Forward packet to other hub ports by their AioContext. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev

[Qemu-devel] [RFC PATCH 0/2] port network layer onto glib

2013-03-12 Thread Liu Ping Fan
use AioContext instead of GSource, but after discussion, I think with GSource, we can integrated with glib more closely. Liu Ping Fan (2): net: port tap onto glib net: port hub onto glib hw/qdev-properties-system.c |1 + include/net/net.h | 24 +++ include/net/queue.h

Re: [Qemu-devel] [RFC v1 3/3] make address_space_map safe

2013-03-06 Thread liu ping fan
a small comment below: On Fri, Nov 09, 2012 at 11:14:30AM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpu-common.h |8 ++-- cputlb.c |4 ++-- dma-helpers.c |4

Re: [Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant ***

2013-03-06 Thread liu ping fan
On Wed, Mar 6, 2013 at 5:30 AM, mdroth mdr...@linux.vnet.ibm.com wrote: On Sun, Mar 03, 2013 at 09:21:19PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com This series aim to make netlayer re-entrant, so netlayer can run out of biglock safely. I think most

[Qemu-devel] [PATCH v2 0/5] make netlayer re-entrant

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com changes v1-v2 Because the NetQueue is exposed not just from qemu_send_queue_xx(), so separating locks -- use NetQueue(NetQueue-lock) to protect the queue, and use nc-send_lock for the access of nc-peer so we can protect the sender from

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

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Forward packet to other hub ports by their AioContext. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev-properties-system.c |1 + include/block/aio.h |1 + include/net/net.h |5 + include/net

[Qemu-devel] [PATCH v2 2/5] net: hub use lock to protect ports list

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- net/hub.c | 27 ++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/net/hub.c b/net/hub.c index 73c1f26..47fe72c 100644 --- a/net/hub.c +++ b/net

[Qemu-devel] [PATCH v2 3/5] net: introduce lock to protect NetQueue

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- net/queue.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/net/queue.c b/net/queue.c index 67959f8..f7ff020 100644 --- a/net/queue.c +++ b/net/queue.c

[Qemu-devel] [PATCH v2 4/5] net: introduce lock to protect NetClientState's peer's access

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Introduce nc-send_lock, it shield off the race of nc-peer's reader and deleter. With it, after deleter finish, no new qemu_send_packet_xx() can reach -send_queue, so no new reference(packet-sender) to nc will be appended to nc-peer-send_queue

[Qemu-devel] [PATCH v2 5/5] net: make netclient re-entrant with refcnt

2013-03-06 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com With refcnt, NetClientState's caller can run agaist reclaimer. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev-properties-system.c | 14 + include/net/net.h |3 ++ net/hub.c |3

Re: [Qemu-devel] [PATCH 2/3] net: introduce lock to protect NetClientState's send_queue

2013-03-04 Thread liu ping fan
On Mon, Mar 4, 2013 at 11:04 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 04/03/2013 15:49, Stefan Hajnoczi ha scritto: Use nc-transfer_lock to protect the nc-peer-send_queue. All of the Please use consistent names: the lock protects -send_queue so it's best called send_queue_lock or

Re: [Qemu-devel] [PATCH 2/3] net: introduce lock to protect NetClientState's send_queue

2013-03-04 Thread liu ping fan
On Mon, Mar 4, 2013 at 10:49 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Sun, Mar 03, 2013 at 09:21:21PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Use nc-transfer_lock to protect the nc-peer-send_queue. All of the Please use consistent names: the lock

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

2013-03-04 Thread liu ping fan
On Mon, Mar 4, 2013 at 10:35 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Sun, Mar 03, 2013 at 09:21:20PM +0800, Liu Ping Fan wrote: @@ -44,6 +47,7 @@ typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int); typedef void (NetCleanup) (NetClientState *); typedef

Re: [Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt

2013-03-04 Thread liu ping fan
On Mon, Mar 4, 2013 at 11:19 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Sun, Mar 03, 2013 at 09:21:22PM +0800, Liu Ping Fan wrote: diff --git a/net/hub.c b/net/hub.c index 97c3ac3..ab4448e 100644 --- a/net/hub.c +++ b/net/hub.c @@ -36,6 +36,7 @@ typedef struct NetHubPort

Re: [Qemu-devel] [PATCH 2/3] net: introduce lock to protect NetClientState's send_queue

2013-03-04 Thread liu ping fan
On Tue, Mar 5, 2013 at 10:45 AM, liu ping fan qemul...@gmail.com wrote: On Mon, Mar 4, 2013 at 10:49 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Sun, Mar 03, 2013 at 09:21:21PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Use nc-transfer_lock to protect

[Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant ***

2013-03-03 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This series aim to make netlayer re-entrant, so netlayer can run out of biglock safely. Liu Ping Fan (3): net: spread hub on AioContexts net: introduce lock to protect NetClientState's send_queue net: make netclient re-entrant with refcnt hw

[Qemu-devel] [PATCH 1/3] net: spread hub on AioContexts

2013-03-03 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Forward packet to other hub ports by their AioContext. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev-properties-system.c |1 + include/block/aio.h |1 + include/net/net.h |5 + include/net

[Qemu-devel] [PATCH 2/3] net: introduce lock to protect NetClientState's send_queue

2013-03-03 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Use nc-transfer_lock to protect the nc-peer-send_queue. All of the deleter and senders will sync on this lock, so we can also survive across unplug. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- include/net/net.h |4 +++ include

[Qemu-devel] [PATCH 3/3] net: make netclient re-entrant with refcnt

2013-03-03 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com With refcnt, NetClientState's caller can run agaist reclaimer. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev-properties-system.c | 14 ++ include/net/net.h |3 +++ net/hub.c | 29

Re: [Qemu-devel] [PATCH 6/9] virtio net: introduce dataplane for virtio net

2013-02-27 Thread liu ping fan
On Fri, Feb 22, 2013 at 4:55 AM, mdroth mdr...@linux.vnet.ibm.com wrote: On Thu, Feb 21, 2013 at 08:54:50PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com This is a emulation to virtio-blk dataplane, which push the data handling out of biglock. And it is a try

Re: [Qemu-devel] [PATCH 0/9] introduce virtio net dataplane

2013-02-27 Thread liu ping fan
On Tue, Feb 26, 2013 at 1:53 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 25/02/2013 18:35, mdroth ha scritto: Moving more of the os_host_main_loop_wait to AioContext would be possible (timers are on the todo list, in fact), but we should only do it as need arises. Were you planning on

Re: [Qemu-devel] [PATCH 0/9] introduce virtio net dataplane

2013-02-27 Thread liu ping fan
+0800, Liu Ping Fan wrote: This is a emulation to virtio-blk dataplane, which push the data handling out of biglock. And it is a try to implement this process in userspace, while vhost-net in kernel. What's the motivation for doing this? I haven't looked carefully at the patches

[Qemu-devel] [PATCH 2/9] vring: introduce vring_restore() to restore from img

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Re-initialize the members of vring correctly is required when restored from img. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/vring.c |6 ++ hw/dataplane/vring.h |1 + 2 files changed, 7 insertions(+), 0

[Qemu-devel] [PATCH 3/9] event poll: make epoll work for normal fd

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com When event poll can work with normal fd, we can port them onto the event loop. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/event-poll.c | 36 hw/dataplane/event-poll.h |8

[Qemu-devel] [PATCH 4/9] event poll: pass event type to event callback

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com With this extra arg -- event type, we can support the standard events dispatched by epoll_wait() Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/event-poll.c |4 ++-- hw/dataplane/event-poll.h |2 +- hw/dataplane

[Qemu-devel] [PATCH 6/9] virtio net: introduce dataplane for virtio net

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This is a emulation to virtio-blk dataplane, which push the data handling out of biglock. And it is a try to implement this process in userspace, while vhost-net in kernel. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane

[Qemu-devel] [PATCH 8/9] virtio net: enable dataplane for virtio net

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/virtio-net.c | 38 ++ hw/virtio-net.h |3 +++ hw/virtio-pci.c |2 +- 3 files changed, 42 insertions(+), 1 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 0/9] introduce virtio net dataplane

2013-02-21 Thread Liu Ping Fan
optimized). Todo: implement fine lock for net-subsystem Liu Ping Fan (9): vring: split the modification and publish of used ring vring: introduce vring_restore() to restore from img event poll: make epoll work for normal fd event poll: pass event type to event callback event poll: enable

[Qemu-devel] [PATCH 7/9] tap: make tap peer work on dedicated data-plane thread

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/virtio-net.c | 22 +++ hw/dataplane/virtio-net.h |6 +++ include/net/tap.h |6 +++ net/tap.c | 92

[Qemu-devel] [PATCH 1/9] vring: split the modification and publish of used ring

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vring_push() modify used ring and publish it, but sometime, we need to gather the changes and publish them all at once. So introduce vring_fill(), vring_flush(). Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane

[Qemu-devel] [PATCH 5/9] event poll: enable event poll handle more than one event each time

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Set handled event count at initialized time for the dedicated thread. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/dataplane/event-poll.c | 31 ++- hw/dataplane/event-poll.h |4 +++- hw/dataplane

[Qemu-devel] [PATCH 9/9] configure: make virtio net dataplane configurable

2013-02-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- configure | 12 hw/dataplane/Makefile.objs |4 +++- 2 files changed, 15 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 837a84a

Re: [Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-12-12 Thread liu ping fan
Hi Jan and Cam, It has been tested with uio driver. And other opinion for the code? Regards, Pingfan On Thu, Dec 6, 2012 at 2:37 PM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs

Re: [Qemu-devel] [PATCH v5 03/11] dataplane: add host memory mapping code

2012-12-08 Thread liu ping fan
On Thu, Dec 6, 2012 at 4:47 AM, Stefan Hajnoczi stefa...@redhat.com wrote: The data plane thread needs to map guest physical addresses to host pointers. Normally this is done with cpu_physical_memory_map() but the function assumes the global mutex is held. The data plane thread does not

Re: [Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-12-05 Thread liu ping fan
On Thu, Dec 6, 2012 at 1:10 PM, Cam Macdonell c...@cs.ualberta.ca wrote: On Wed, Dec 5, 2012 at 1:50 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-12-05 06:34, Cam Macdonell wrote: static void ivshmem_write_config(PCIDevice *pci_dev, uint32_t address,

[Qemu-devel] [PATCH v2 1/2] ivshmem: remove msix_write_config

2012-12-05 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This logic has been integrated into pci core, so remove it. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Cam Macdonell c...@cs.ualberta.ca --- hw/ivshmem.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff

[Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-12-05 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs interrupts each other. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Cam Macdonell c...@cs.ualberta.ca --- hw/ivshmem.c | 54

Re: [Qemu-devel] [PATCH v7 0/7] push mmio dispatch out of big lock

2012-12-05 Thread liu ping fan
Any suggestion? Or new design idea for this? Thanks Pingfan On Sun, Nov 25, 2012 at 10:02 AM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com v1: https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03312.html v2: http://lists.gnu.org/archive/html

Re: [Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-11-29 Thread liu ping fan
On Thu, Nov 29, 2012 at 12:42 PM, Cam Macdonell c...@cs.ualberta.ca wrote: On Tue, Nov 27, 2012 at 7:53 PM, liu ping fan qemul...@gmail.com wrote: On Wed, Nov 28, 2012 at 5:48 AM, Cam Macdonell c...@cs.ualberta.ca wrote: On Sat, Nov 24, 2012 at 8:51 PM, Liu Ping Fan qemul...@gmail.com wrote

Re: [Qemu-devel] [PATCH v7 1/7] qom: apply atomic on object's refcount

2012-11-29 Thread liu ping fan
On Thu, Nov 29, 2012 at 1:16 AM, Richard Henderson r...@twiddle.net wrote: On 11/24/2012 06:02 PM, Liu Ping Fan wrote: -obj-ref--; /* parent always holds a reference to its children */ -if (obj-ref == 0) { +if (__sync_fetch_and_sub(obj-ref, 1) == 1

Re: [Qemu-devel] [PATCH v2 1/2] ivshmem: remove msix_write_config

2012-11-28 Thread liu ping fan
ping? On Sun, Nov 25, 2012 at 11:51 AM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com This logic has been integrated into pci core, so remove it. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/ivshmem.c |1 - 1 files changed, 0

Re: [Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-11-27 Thread liu ping fan
On Wed, Nov 28, 2012 at 5:48 AM, Cam Macdonell c...@cs.ualberta.ca wrote: On Sat, Nov 24, 2012 at 8:51 PM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs interrupts each other. Nice

[Qemu-devel] [PATCH v7 0/7] push mmio dispatch out of big lock

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com v1: https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03312.html v2: http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg01275.html v3: http://lists.nongnu.org/archive/html/qemu-devel/2012-09/msg01474.html v4: http://lists.gnu.org

[Qemu-devel] [PATCH v7 1/7] qom: apply atomic on object's refcount

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- qom/object.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index e3e9242..1a697b3 100644 --- a/qom/object.c +++ b/qom/object.c

[Qemu-devel] [PATCH v7 2/7] hotplug: introduce qdev_unplug_complete() to remove device from views

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com When device unplug has been ack by guest, we first remove it from memory to prevent incoming access from dispatcher. Then we isolate it from device composition tree Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/qdev.c | 26

[Qemu-devel] [PATCH v7 3/7] pci: remove pci device from mem view when unplug

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/acpi_piix4.c |2 +- hw/pci.c| 13 - hw/pci.h|1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c

[Qemu-devel] [PATCH v7 4/7] memory: introduce local lock for address space

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com For those address spaces which want to be able out of big lock, they will be protected by their own local. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- memory.c |1 + memory.h |3 +++ 2 files changed, 4 insertions(+), 0

[Qemu-devel] [PATCH v7 5/7] memory: make mmio dispatch able to be out of biglock

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Without biglock, we try to protect the mr by increase refcnt. If we cannot inc refcnt, go backward and resort to biglock. Another point is memory radix-tree can be flushed by another thread, so we should get the copy of terminal mr to survive from

[Qemu-devel] [PATCH v7 6/7] memory: introduce tls context to trace nested mmio request issue

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com After breaking down big lock, nested MMIO request which not targeting at RAM can cause deadlock issue. Supposing the scene: dev_a,b with fine-grain locks lockA/B, then ABBA dealock issue can be triggered. We fix this by tracing and rejecting

[Qemu-devel] [PATCH v7 7/7] vcpu: push mmio dispatcher out of big lock

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com To anti the recursive big lock, introduce separate interfaces to allow address space dispatcher called with/without big lock. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpu-common.h |3 +++ exec.c | 21

[Qemu-devel] [PATCH v2 1/2] ivshmem: remove msix_write_config

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com This logic has been integrated into pci core, so remove it. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/ivshmem.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/ivshmem.c b/hw/ivshmem.c index f6dbb21

[Qemu-devel] [PATCH v2 2/2] ivshmem: use irqfd to interrupt among VMs

2012-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs interrupts each other. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/ivshmem.c | 54 +- 1 files changed, 53

Re: [Qemu-devel] [PATCH] ivshmem: use irqfd to interrupt among VMs

2012-11-22 Thread liu ping fan
On Thu, Nov 22, 2012 at 7:40 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-11-22 03:48, liu ping fan wrote: On Wed, Nov 21, 2012 at 8:43 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-11-21 07:02, Liu Ping Fan wrote: [...] +static int ivshmem_vector_use(PCIDevice *dev, unsigned

Re: [Qemu-devel] [PATCH] ivshmem: use irqfd to interrupt among VMs

2012-11-21 Thread liu ping fan
On Wed, Nov 21, 2012 at 8:43 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-11-21 07:02, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs interrupts each other. Signed-off-by: Liu Ping Fan pingf

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-20 Thread liu ping fan
On Sun, Nov 18, 2012 at 6:04 PM, Avi Kivity a...@redhat.com wrote: On 11/15/2012 09:47 AM, liu ping fan wrote: On Wed, Nov 14, 2012 at 5:47 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/11/2012 10:38, liu ping fan ha scritto: On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini pbonz

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-20 Thread liu ping fan
On Fri, Nov 16, 2012 at 8:03 AM, Richard Henderson r...@twiddle.net wrote: On 2012-11-14 23:47, liu ping fan wrote: Probably I made a mistake here, in vhost, log = __sync_fetch_and_and(from, 0) is used to fetch 64bits atomically in the case 32bits qemu running on 64bits linux. Right

[Qemu-devel] [PATCH] ivshmem: use irqfd to interrupt among VMs

2012-11-20 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using irqfd, so we can avoid switch between kernel and user when VMs interrupts each other. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/ivshmem.c | 48 +++- 1 files changed, 47

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-14 Thread liu ping fan
On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 05/11/2012 06:38, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is a wrapper

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-14 Thread liu ping fan
On Wed, Nov 14, 2012 at 5:47 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/11/2012 10:38, liu ping fan ha scritto: On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 05/11/2012 06:38, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com

Re: [Qemu-devel] [RFC v1 2/3] ramlist: apply fine grain lock for ram_list

2012-11-12 Thread liu ping fan
On Mon, Nov 12, 2012 at 4:48 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 12/11/2012 07:22, liu ping fan ha scritto: On Sat, Nov 10, 2012 at 9:54 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 09/11/2012 04:14, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH v6 3/8] hotplug: introduce qdev_unplug_complete() to remove device from views

2012-11-12 Thread liu ping fan
On Mon, Nov 12, 2012 at 5:27 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 05/11/2012 06:38, Liu Ping Fan ha scritto: +void qdev_unplug_complete(DeviceState *dev, Error **errp) +{ +/* isolate from mem view */ +qdev_unmap(dev); +/* isolate from device tree

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-12 Thread liu ping fan
On Mon, Nov 12, 2012 at 5:54 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 05/11/2012 06:38, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is a wrapper of GCC atomic

Re: [Qemu-devel] [RFC v1 2/3] ramlist: apply fine grain lock for ram_list

2012-11-11 Thread liu ping fan
On Sat, Nov 10, 2012 at 9:54 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 09/11/2012 04:14, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpu-all.h |1 + exec.c| 46

Re: [Qemu-devel] [RFC v1 1/3] bouce buffer has fine grain lock

2012-11-11 Thread liu ping fan
On Sat, Nov 10, 2012 at 9:49 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 09/11/2012 04:14, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- exec.c | 21 + 1 files changed, 13

[Qemu-devel] [RFC v1 0/3] make address_space_map() safe without biglock's protection

2012-11-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com No access google. For background, please refer to discussion for [RFC PATCH v3 05/19] Implement dimm device abstraction Liu Ping Fan (3): bouce buffer has fine grain lock ramlist: apply fine grain lock for ram_list make address_space_map

[Qemu-devel] [RFC v1 1/3] bouce buffer has fine grain lock

2012-11-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- exec.c | 21 + 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index 73d5242..fe84718 100644 --- a/exec.c +++ b/exec.c @@ -3296,6

[Qemu-devel] [RFC v1 2/3] ramlist: apply fine grain lock for ram_list

2012-11-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpu-all.h |1 + exec.c| 46 +++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 6aa7e58

[Qemu-devel] [RFC v1 3/3] make address_space_map safe

2012-11-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpu-common.h |8 ++-- cputlb.c |4 ++-- dma-helpers.c |4 +++- dma.h |5 - exec.c| 45

Re: [Qemu-devel] [PATCH v6 0/8] push mmio dispatch out of big lock

2012-11-08 Thread liu ping fan
Ping? Any further comments? Thanks and regards, Pingfan On Mon, Nov 5, 2012 at 3:00 PM, Jan Kiszka jan.kis...@web.de wrote: On 2012-11-05 06:38, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com v1: https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03312.html v2

Re: [Qemu-devel] [patch v5 7/8] memory: introduce tls context to record nested dma

2012-11-04 Thread liu ping fan
On Mon, Oct 29, 2012 at 4:51 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 29/10/2012 00:48, Liu Ping Fan ha scritto: Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpus.c|3 ++ exec.c| 58 + qemu

Re: [Qemu-devel] [patch v5 7/8] memory: introduce tls context to record nested dma

2012-11-04 Thread liu ping fan
On Fri, Nov 2, 2012 at 6:39 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2012-10-29 00:48, Liu Ping Fan wrote: Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpus.c|3 ++ exec.c| 58 + qemu

[Qemu-devel] [PATCH v6 0/8] push mmio dispatch out of big lock

2012-11-04 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com v1: https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03312.html v2: http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg01275.html v3: http://lists.nongnu.org/archive/html/qemu-devel/2012-09/msg01474.html v4: http://lists.gnu.org

<    1   2   3   4   5   6   7   8   >