[Qemu-devel] [PATCH V11 0/9] Introduce COLO-compare and filter-rewriter

2016-07-28 Thread Zhang Chen
some comments - other bug fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (9): colo-compare: introduce colo compare initialization colo-base: add colo-base to define and handle packet Jhash: add linux kernel jhashtable in qemu colo-comp

[Qemu-devel] [PATCH V11 8/9] filter-rewriter: track connection and parse packet

2016-07-28 Thread Zhang Chen
We use colo-base.h to track connection and parse packet Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c | 14 ++ net/colo-base.h | 1 + net/filter-rewriter.c | 50 ++ 3

[Qemu-devel] [PATCH V11 1/9] colo-compare: introduce colo compare initialization

2016-07-28 Thread Zhang Chen
ctor,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 222 +

[Qemu-devel] [PATCH V11 2/9] colo-base: add colo-base to define and handle packet

2016-07-28 Thread Zhang Chen
COLO-base used by colo-compare and filter-rewriter. this can share common data structure like:net packet, and share other functions. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-base.c| 74

[Qemu-devel] [PATCH V11 4/9] colo-compare: track connection and enqueue packet

2016-07-28 Thread Zhang Chen
;s own conn. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 108 + net/colo-base.h| 27 ++ net/colo-compare.c | 70 +- 3 files c

[Qemu-devel] [PATCH V11 3/9] Jhash: add linux kernel jhashtable in qemu

2016-07-28 Thread Zhang Chen
Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 1 file changed, 61 insertions(+) create

[Qemu-devel] [PATCH V11 5/9] colo-compare: introduce packet comparison thread

2016-07-28 Thread Zhang Chen
checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 212 + trace-events | 2 + 4 files changed, 218 insertions(+) diff

[Qemu-devel] [PATCH V11 6/9] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-28 Thread Zhang Chen
We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 174

[Qemu-devel] [PATCH V11 9/9] filter-rewriter: rewrite tcp packet to keep secondary connection

2016-07-28 Thread Zhang Chen
ction kept good. In code We use offset( = secondary_seq - primary_seq ) to rewrite seq or ack. handle_primary_tcp_pkt: tcp_pkt->th_ack += offset; handle_secondary_tcp_pkt: tcp_pkt->th_seq -= offset; Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang ---

Re: [Qemu-devel] [PATCH V11 8/9] filter-rewriter: track connection and parse packet

2016-08-02 Thread Zhang Chen
On 08/02/2016 04:23 PM, Jason Wang wrote: On 2016年07月28日 18:12, Zhang Chen wrote: We use colo-base.h to track connection and parse packet Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c | 14 ++ net/colo-base.h

Re: [Qemu-devel] [RFC PATCH V10 1/7] colo-compare: introduce colo compare initialization

2016-08-02 Thread Zhang Chen
On 08/02/2016 02:26 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: This a COLO net ascii figure: Primary qemu Secondary qemu

Re: [Qemu-devel] [RFC PATCH V10 2/7] colo-base: add colo-base to define and handle packet

2016-08-02 Thread Zhang Chen
On 08/02/2016 02:38 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: COLO-base used by colo-compare and filter-rewriter. s/used/is used/ OK~ this can share common data structure like:net packet, s/this/This/ and ':' looks unnecessary. OK~ and share other

Re: [Qemu-devel] [RFC PATCH V10 3/7] Jhash: add linux kernel jhashtable in qemu

2016-08-02 Thread Zhang Chen
On 08/02/2016 02:40 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61

Re: [Qemu-devel] [PATCH V3] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-08-03 Thread Zhang Chen
Hi~~ Paolo and Daniel. No news for a week~ Can you give me some feedback for this patch? We need comments... Thanks Zhang Chen On 07/28/2016 05:12 PM, Zhang Chen wrote: Add qemu_chr_add_handlers_full() API, we can use this API pass in a GMainContext,make handler run in the context rather

Re: [Qemu-devel] [RFC PATCH V10 4/7] colo-compare: track connection and enqueue packet

2016-08-03 Thread Zhang Chen
On 08/02/2016 03:14 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState ++ | | +---+ +---+ +---+ |conn

Re: [Qemu-devel] [PATCH V3] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-08-04 Thread Zhang Chen
On 08/04/2016 04:05 PM, Daniel P. Berrange wrote: On Thu, Jul 28, 2016 at 05:12:25PM +0800, Zhang Chen wrote: Add qemu_chr_add_handlers_full() API, we can use this API pass in a GMainContext,make handler run in the context rather than main_loop. This comments from Daniel P . Berrange. Signed

[Qemu-devel] [PATCH V4] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-08-04 Thread Zhang Chen
Add qemu_chr_add_handlers_full() API, we can use this API pass in a GMainContext,make handler run in the context rather than main_loop. This comments from Daniel P . Berrange. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang Reviewed-by: Daniel P. Berrange

Re: [Qemu-devel] [RFC PATCH V10 6/7] colo-compare: introduce packet comparison thread

2016-08-05 Thread Zhang Chen
On 08/02/2016 03:52 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: If primary packet is same with secondary packet, we will send primary packet and drop secondary packet, otherwise notify COLO frame to do checkpoint. If primary packet comes and secondary packet not, s/and

Re: [Qemu-devel] [RFC PATCH V10 7/7] colo-compare: add TCP, UDP, ICMP packet comparison

2016-08-05 Thread Zhang Chen
On 08/02/2016 04:04 PM, Jason Wang wrote: On 2016年07月26日 09:49, Zhang Chen wrote: We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. s/less/Less/ OK. Signed-off-by: Zhang

Re: [Qemu-devel] [RFC PATCH V5 0/4] Introduce COLO-compare

2016-07-07 Thread Zhang Chen
Hi~~ Jason~ Have any comments? By the way this patch set depend on the patch [RFC PATCH V2] qemu-char: Fix context for g_source_attach() but no one review itany suggestion? Thanks Zhang Chen On 06/23/2016 07:34 PM, Zhang Chen wrote: COLO-compare is a part of COLO project. It is used to

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-07 Thread Zhang Chen
On 06/29/2016 02:46 PM, Zhang Chen wrote: On 06/22/2016 06:49 PM, Zhang Chen wrote: Hi~ Paolo~ Just a ping...no news for a week~ Ping...again... CC Fam This patch about main loop. Thanks Zhang Chen We want to poll and handle chardev in another thread other than main loop. But

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-07 Thread Zhang Chen
On 07/08/2016 09:48 AM, Fam Zheng wrote: On Wed, 06/22 18:49, Zhang Chen wrote: We want to poll and handle chardev in another thread other than main loop. But qemu_chr_add_handlers() can only work for global default context other than thread default context. So we use g_source_attach(xx

Re: [Qemu-devel] [RFC PATCH V5 1/4] colo-compare: introduce colo compare initialization

2016-07-08 Thread Zhang Chen
On 07/08/2016 11:40 AM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: Packets coming from the primary char indev will be sent to outdev Packets coming from the secondary char dev will be dropped usage: primary: -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript

Re: [Qemu-devel] [RFC PATCH V5 2/4] colo-compare: track connection and enqueue packet

2016-07-08 Thread Zhang Chen
On 07/08/2016 12:07 PM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState ++ | | +---+ +---+ +---+ |conn

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-10 Thread Zhang Chen
On 07/08/2016 10:27 PM, Paolo Bonzini wrote: On 08/07/2016 10:54, Daniel P. Berrange wrote: On Fri, Jul 08, 2016 at 09:48:23AM +0800, Fam Zheng wrote: On Wed, 06/22 18:49, Zhang Chen wrote: We want to poll and handle chardev in another thread other than main loop. But qemu_chr_add_handlers

Re: [Qemu-devel] [RFC PATCH V5 1/4] colo-compare: introduce colo compare initialization

2016-07-10 Thread Zhang Chen
On 07/08/2016 05:12 PM, Jason Wang wrote: On 2016年07月08日 16:21, Zhang Chen wrote: On 07/08/2016 11:40 AM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: Packets coming from the primary char indev will be sent to outdev Packets coming from the secondary char dev will be

Re: [Qemu-devel] [RFC PATCH V5 3/4] colo-compare: introduce packet comparison thread

2016-07-11 Thread Zhang Chen
On 07/08/2016 12:23 PM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. More verbose please, e.g how to handle each case of exception (or maybe comment in the code

Re: [Qemu-devel] [RFC PATCH V5 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-11 Thread Zhang Chen
On 07/08/2016 04:59 PM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 171 +++-- trace-events | 6 ++ 2 files

Re: [Qemu-devel] [RFC PATCH V5 2/4] colo-compare: track connection and enqueue packet

2016-07-11 Thread Zhang Chen
On 07/11/2016 01:41 PM, Jason Wang wrote: On 2016年07月08日 17:56, Zhang Chen wrote: On 07/08/2016 12:07 PM, Jason Wang wrote: On 2016年06月23日 19:34, Zhang Chen wrote: In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState

Re: [Qemu-devel] [RFC PATCH V5 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-12 Thread Zhang Chen
On 07/13/2016 10:54 AM, Jason Wang wrote: On 2016年07月11日 18:02, Zhang Chen wrote: +static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt) +{ +int network_length; +struct icmp *icmp_ppkt, *icmp_spkt; + +trace_colo_compare_main("compare icmp"); +network_len

[Qemu-devel] [RFC PATCH V6 4/6] colo-compare: track connection and enqueue packet

2016-07-15 Thread Zhang Chen
;s own conn. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 108 + net/colo-base.h| 30 +++ net/colo-compare.c | 70 +- 3 files c

[Qemu-devel] [RFC PATCH V6 0/6] Introduce COLO-compare

2016-07-15 Thread Zhang Chen
fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (6): colo-compare: introduce colo compare initialization colo-base: add colo-base to define and handle packet Jhash: add linux kernel jhashtable in qemu colo-compare: track connectio

[Qemu-devel] [RFC PATCH V6 6/6] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-15 Thread Zhang Chen
We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 174

[Qemu-devel] [RFC PATCH V6 1/6] colo-compare: introduce colo compare initialization

2016-07-15 Thread Zhang Chen
ctor,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 222 +

[Qemu-devel] [RFC PATCH V6 3/6] Jhash: add linux kernel jhashtable in qemu

2016-07-15 Thread Zhang Chen
Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 1 file changed, 61 insertions(+) create

[Qemu-devel] [RFC PATCH V6 2/6] colo-base: add colo-base to define and handle packet

2016-07-15 Thread Zhang Chen
COLO-base used by colo-compare and filter-rewriter. this can share common data structure like:net packet, and share other functions. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-base.c| 74

[Qemu-devel] [RFC PATCH V6 5/6] colo-compare: introduce packet comparison thread

2016-07-15 Thread Zhang Chen
checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 216 + trace-events | 2 + 4 files changed, 222 insertions(+) diff

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
from Jason. Thanks Zhang Chen On 07/11/2016 10:12 AM, Zhang Chen wrote: On 07/08/2016 10:27 PM, Paolo Bonzini wrote: On 08/07/2016 10:54, Daniel P. Berrange wrote: On Fri, Jul 08, 2016 at 09:48:23AM +0800, Fam Zheng wrote: On Wed, 06/22 18:49, Zhang Chen wrote: We want to poll and

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
On 07/18/2016 01:31 PM, Jason Wang wrote: On 2016年07月18日 09:55, Zhang Chen wrote: Hi~ All~~ Can you give me some feedback for this patch? We need more comments~~ COLO project depend on this patch to work. Because this patch colo-compare can make handler of qemu_chr_add_handlers() run

[Qemu-devel] [RFC PATCH V7 0/7] Introduce COLO-compare

2016-07-17 Thread Zhang Chen
g fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (7): colo-compare: introduce colo compare initialization colo-base: add colo-base to define and handle packet Jhash: add linux kernel jhashtable in qemu colo-compare: track connection a

[Qemu-devel] [RFC PATCH V7 4/7] colo-compare: track connection and enqueue packet

2016-07-17 Thread Zhang Chen
;s own conn. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 108 + net/colo-base.h| 30 +++ net/colo-compare.c | 70 +- 3 files c

[Qemu-devel] [RFC PATCH V7 3/7] Jhash: add linux kernel jhashtable in qemu

2016-07-17 Thread Zhang Chen
Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 1 file changed, 61 insertions(+) create

[Qemu-devel] [RFC PATCH V7 6/7] colo-compare: introduce packet comparison thread

2016-07-17 Thread Zhang Chen
checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 216 + trace-events | 2 + 4 files changed, 222 insertions(+) diff

[Qemu-devel] [RFC PATCH V7 7/7] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-17 Thread Zhang Chen
We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 174

[Qemu-devel] [RFC PATCH V7 5/7] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
. Comments from jason. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- io/channel.c | 2 +- qemu-char.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io/channel.c b/io/channel.c index 692eb17..cd25677 100644 --- a/io/channel.c +++ b/io/channel.c @@ -146,7

[Qemu-devel] [RFC PATCH V7 2/7] colo-base: add colo-base to define and handle packet

2016-07-17 Thread Zhang Chen
COLO-base used by colo-compare and filter-rewriter. this can share common data structure like:net packet, and share other functions. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-base.c| 74

[Qemu-devel] [RFC PATCH V7 1/7] colo-compare: introduce colo compare initialization

2016-07-17 Thread Zhang Chen
ctor,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 222 +

[Qemu-devel] [RFC PATCH V7 0/7] Introduce COLO-compare

2016-07-18 Thread Zhang Chen
g fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (7): colo-compare: introduce colo compare initialization colo-base: add colo-base to define and handle packet Jhash: add linux kernel jhashtable in qemu colo-compare: track connection a

[Qemu-devel] [RFC PATCH V7 6/7] colo-compare: introduce packet comparison thread

2016-07-18 Thread Zhang Chen
checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 216 + trace-events | 2 + 4 files changed, 222 insertions(+) diff

[Qemu-devel] [RFC PATCH V7 2/7] colo-base: add colo-base to define and handle packet

2016-07-18 Thread Zhang Chen
COLO-base used by colo-compare and filter-rewriter. this can share common data structure like:net packet, and share other functions. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-base.c| 74

[Qemu-devel] [RFC PATCH V7 5/7] qemu-char: Fix context for g_source_attach()

2016-07-18 Thread Zhang Chen
. Comments from jason. Cc: Daniel P . Berrange Cc: Paolo Bonzini Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- io/channel.c | 2 +- qemu-char.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io/channel.c b/io/channel.c index 692eb17..cd25677 100644 --- a

[Qemu-devel] [RFC PATCH V7 3/7] Jhash: add linux kernel jhashtable in qemu

2016-07-18 Thread Zhang Chen
Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 1 file changed, 61 insertions(+) create

[Qemu-devel] [RFC PATCH V7 1/7] colo-compare: introduce colo compare initialization

2016-07-18 Thread Zhang Chen
ctor,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 222 +

[Qemu-devel] [RFC PATCH V7 4/7] colo-compare: track connection and enqueue packet

2016-07-18 Thread Zhang Chen
;s own conn. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 108 + net/colo-base.h| 30 +++ net/colo-compare.c | 70 +- 3 files c

[Qemu-devel] [RFC PATCH V7 7/7] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-18 Thread Zhang Chen
We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 174

Re: [Qemu-devel] [RFC PATCH V7 6/7] colo-compare: introduce packet comparison thread

2016-07-18 Thread Zhang Chen
On 07/18/2016 04:37 PM, Daniel P. Berrange wrote: On Mon, Jul 18, 2016 at 03:40:49PM +0800, Zhang Chen wrote: If primary packet is same with secondary packet, we will send primary packet and drop secondary packet, otherwise notify COLO frame to do checkpoint. If primary packet comes and

Re: [Qemu-devel] [RFC PATCH V7 6/7] colo-compare: introduce packet comparison thread

2016-07-19 Thread Zhang Chen
On 07/19/2016 05:03 PM, Daniel P. Berrange wrote: On Tue, Jul 19, 2016 at 11:32:41AM +0800, Zhang Chen wrote: On 07/18/2016 04:37 PM, Daniel P. Berrange wrote: On Mon, Jul 18, 2016 at 03:40:49PM +0800, Zhang Chen wrote: If primary packet is same with secondary packet, we will send primary

Re: [Qemu-devel] [PATCH V6 02/10] net/filter-mirror.c: Make filter mirror support vnet support.

2017-06-14 Thread Zhang Chen
On 06/13/2017 05:14 PM, Jason Wang wrote: On 2017年06月12日 17:27, Zhang Chen wrote: +if (nf->direction == NET_FILTER_DIRECTION_RX || +nf->direction == NET_FILTER_DIRECTION_ALL) { +vnet_hdr_len = nf->netdev->vnet_hdr_len; This can only work if e.

Re: [Qemu-devel] [PATCH V6 02/10] net/filter-mirror.c: Make filter mirror support vnet support.

2017-06-15 Thread Zhang Chen
On 06/15/2017 12:31 PM, Jason Wang wrote: On 2017年06月14日 16:04, Zhang Chen wrote: On 06/13/2017 05:14 PM, Jason Wang wrote: On 2017年06月12日 17:27, Zhang Chen wrote: +if (nf->direction == NET_FILTER_DIRECTION_RX || +nf->direction == NET_FILTER_DIRECTI

Re: [Qemu-devel] [PATCH V6 02/10] net/filter-mirror.c: Make filter mirror support vnet support.

2017-06-16 Thread Zhang Chen
On 06/16/2017 10:17 AM, Jason Wang wrote: On 2017年06月15日 16:10, Zhang Chen wrote: On 06/15/2017 12:31 PM, Jason Wang wrote: On 2017年06月14日 16:04, Zhang Chen wrote: On 06/13/2017 05:14 PM, Jason Wang wrote: On 2017年06月12日 17:27, Zhang Chen wrote: +if (nf->direct

[Qemu-devel] [PATCH] colo-compare: Fix old packet check bug.

2017-04-12 Thread Zhang Chen
If colo-compare find one old packet,we can notify colo-frame do checkpoint, no need continue find more old packet here. Signed-off-by: Zhang Chen --- net/colo-compare.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c

[Qemu-devel] [PATCH] net/filter-rewriter.c: Fix trace_event print bug

2017-04-13 Thread Zhang Chen
Because of inet_ntoa() return a statically allocated buffer, subsequent calls will overwrite, So we fix this bug. Signed-off-by: Zhang Chen --- net/filter-rewriter.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c

[Qemu-devel] [PATCH 2/2] COLO-compare: Optimize tcp compare trace event

2017-04-16 Thread Zhang Chen
Optimize two trace events as one, adjust print format make it easy to read. rename trace_colo_compare_pkt_info_src/dst to trace_colo_compare_tcp_info. Signed-off-by: Zhang Chen --- net/colo-compare.c | 29 + net/trace-events | 3 +-- 2 files changed, 18 insertions

[Qemu-devel] [PATCH 1/2] COLO-compare: Optimize tcp compare for option field

2017-04-16 Thread Zhang Chen
In this patch we support packet that have tcp options field. Add tcp options field check, If the packet have options field we just skip it and compare tcp payload, Avoid unnecessary checkpoint, optimize performance. Signed-off-by: Zhang Chen --- net/colo-compare.c | 27

[Qemu-devel] [PATCH 0/2] COLO-compare: Optimize tcp compare performance and trace format.

2017-04-16 Thread Zhang Chen
In the first patch, we add tcp options support to optimize compare performance. and another patch simplified code and adjust trace print format. Zhang Chen (2): COLO-compare: Optimize tcp compare for option field COLO-compare: Optimize tcp compare trace event net/colo-compare.c | 54

Re: [Qemu-devel] [PATCH 02/15] colo-compare: implement the process of checkpoint

2017-04-17 Thread Zhang Chen
On 04/17/2017 07:04 PM, Hailiang Zhang wrote: Hi Jason, On 2017/4/14 14:38, Jason Wang wrote: On 2017年04月14日 14:22, Hailiang Zhang wrote: Hi Jason, On 2017/4/14 13:57, Jason Wang wrote: On 2017年02月22日 17:31, Zhang Chen wrote: On 02/22/2017 11:42 AM, zhanghailiang wrote: While do

Re: [Qemu-devel] [PATCH 1/2] COLO-compare: Optimize tcp compare for option field

2017-04-17 Thread Zhang Chen
On 04/17/2017 09:43 PM, Philippe Mathieu-Daudé wrote: Hi Zhang, On 04/16/2017 06:24 AM, Zhang Chen wrote: In this patch we support packet that have tcp options field. Add tcp options field check, If the packet have options field we just skip it and compare tcp payload, Avoid unnecessary

[Qemu-devel] [PATCH V2 1/2] COLO-compare: Optimize tcp compare for option field

2017-04-17 Thread Zhang Chen
In this patch we support packet that have tcp options field. Add tcp options field check, If the packet have options field we just skip it and compare tcp payload, Avoid unnecessary checkpoint, optimize performance. Signed-off-by: Zhang Chen --- net/colo-compare.c | 27

[Qemu-devel] [PATCH V2 0/2] COLO-compare: Optimize tcp compare performance and trace format.

2017-04-17 Thread Zhang Chen
In the first patch, we add tcp options support to optimize compare performance. and another patch simplified code and adjust trace print format. Zhang Chen (2): COLO-compare: Optimize tcp compare for option field COLO-compare: Optimize tcp compare trace event net/colo-compare.c | 54

[Qemu-devel] [PATCH V2 2/2] COLO-compare: Optimize tcp compare trace event

2017-04-17 Thread Zhang Chen
Optimize two trace events as one, adjust print format make it easy to read. rename trace_colo_compare_pkt_info_src/dst to trace_colo_compare_tcp_info. Signed-off-by: Zhang Chen --- net/colo-compare.c | 29 + net/trace-events | 3 +-- 2 files changed, 18 insertions

[Qemu-devel] [PATCH] COLO-compare: Add compare_lock aviod comparison conflict

2017-04-19 Thread Zhang Chen
will be handle twice. If packet same, the pkt will be double free. Signed-off-by: Zhang Chen --- net/colo-compare.c | 8 1 file changed, 8 insertions(+) diff --git a/net/colo-compare.c b/net/colo-compare.c index 54e6d40..686c1b4 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c

Re: [Qemu-devel] [PATCH] COLO-compare: Add compare_lock aviod comparison conflict

2017-04-19 Thread Zhang Chen
On 04/20/2017 02:20 PM, Hailiang Zhang wrote: On 2017/4/20 12:32, Zhang Chen wrote: When network traffic heavy, compare_pri_rs_finalize() and compare_sec_rs_finalize() have a chance to confilct. Both of them call colo_compare_connection() to compare packet, But during compare_pri_rs_finalize

[Qemu-devel] [PATCH V2 3/6] net/colo-compare.c: Make colo-compare support vnet_hdr_len

2017-04-19 Thread Zhang Chen
COLO-compare can get vnet header length from filter, Add vnet_hdr_len to struct packet and output packet with the vnet_hdr_len. Signed-off-by: Zhang Chen --- net/colo-compare.c| 39 --- net/colo.c| 3 ++- net/colo.h| 4 +++- net

[Qemu-devel] [PATCH V2 4/6] net/socket.c: Add vnet packet support in net_socket_receive()

2017-04-19 Thread Zhang Chen
Because of net_socket_send() add vnet header length argument, Avoid conflict with net_socket_send(). Signed-off-by: Zhang Chen --- net/socket.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/socket.c b/net/socket.c index fe3547b..1f1f3d2 100644 --- a/net/socket.c +++ b/net

[Qemu-devel] [PATCH V2 2/6] net/net.c: Add vnet header length to SocketReadState

2017-04-19 Thread Zhang Chen
Address Jason Wang's comments add vnet header length to SocketReadState. So we change net_fill_rstate() to read struct {int size; int vnet_hdr_len; const uint8_t buf[];}. Signed-off-by: Zhang Chen --- include/net/net.h | 4 +++- net/net.c | 24 ++-- 2 files ch

[Qemu-devel] [PATCH V2 0/6] Add COLO-proxy virtio-net support

2017-04-19 Thread Zhang Chen
If user use -device virtio-net-pci, virtio-net driver will add a header to raw net packet that colo-proxy can't handle it. COLO-proxy just focus on the packet payload, so we skip the virtio-net header to compare the sent packet that primary guest's to secondary guest's. Zhang

[Qemu-devel] [PATCH V2 1/6] net/filter-mirror.c: Add filter-mirror and filter-redirector vnet support.

2017-04-19 Thread Zhang Chen
In this patch, we change the send packet format from struct {int size; const uint8_t buf[];} to {int size; int vnet_hdr_len; const uint8_t buf[];}. make other module(like colo-compare) know how to parse net packet correctly. Signed-off-by: Zhang Chen --- net/filter-mirror.c | 25

[Qemu-devel] [PATCH V2 5/6] net/colo.c: Add vnet packet parse feature in colo-proxy

2017-04-19 Thread Zhang Chen
Make colo-compare and filter-rewriter can parse vnet packet. Signed-off-by: Zhang Chen --- net/colo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/colo.c b/net/colo.c index 180eaed..28ce7c8 100644 --- a/net/colo.c +++ b/net/colo.c @@ -43,11 +43,11 @@ int

[Qemu-devel] [PATCH V2 6/6] net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare

2017-04-19 Thread Zhang Chen
COLO-Proxy just focus on packet payload, So we skip vnet header. Signed-off-by: Zhang Chen --- net/colo-compare.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index b3e933c..1941ad9 100644 --- a/net/colo-compare.c +++ b/net

Re: [Qemu-devel] [PATCH V2 1/2] COLO-compare: Optimize tcp compare for option field

2017-04-20 Thread Zhang Chen
On 04/20/2017 02:43 PM, Jason Wang wrote: On 2017年04月18日 10:20, Zhang Chen wrote: In this patch we support packet that have tcp options field. Add tcp options field check, If the packet have options field we just skip it and compare tcp payload, Avoid unnecessary checkpoint, optimize

Re: [Qemu-devel] [PATCH V2 1/2] COLO-compare: Optimize tcp compare for option field

2017-04-21 Thread Zhang Chen
On 04/21/2017 12:10 PM, Jason Wang wrote: On 2017年04月21日 11:48, Zhang Chen wrote: On 04/20/2017 02:43 PM, Jason Wang wrote: On 2017年04月18日 10:20, Zhang Chen wrote: In this patch we support packet that have tcp options field. Add tcp options field check, If the packet have options

Re: [Qemu-devel] [PATCH V2 0/6] Add COLO-proxy virtio-net support

2017-04-23 Thread Zhang Chen
On 04/24/2017 11:48 AM, Jason Wang wrote: On 2017年04月20日 14:39, Zhang Chen wrote: If user use -device virtio-net-pci, virtio-net driver will add a header to raw net packet that colo-proxy can't handle it. COLO-proxy just focus on the packet payload, so we skip the virtio-net head

Re: [Qemu-devel] [PATCH V2 0/6] Add COLO-proxy virtio-net support

2017-04-24 Thread Zhang Chen
On 04/24/2017 11:48 AM, Jason Wang wrote: On 2017年04月20日 14:39, Zhang Chen wrote: If user use -device virtio-net-pci, virtio-net driver will add a header to raw net packet that colo-proxy can't handle it. COLO-proxy just focus on the packet payload, so we skip the virtio-net head

Re: [Qemu-devel] [PATCH V5 6/9] net/colo-compare.c: Make colo-compare support vnet_hdr_len

2017-06-01 Thread Zhang Chen
On 05/26/2017 01:36 PM, Jason Wang wrote: On 2017年05月26日 13:35, Jason Wang wrote: On 2017年05月25日 21:18, Zhang Chen wrote: @@ -472,7 +474,10 @@ static void colo_compare_connection(void *opaque, void *user_data) } if (result) { -ret = compare_chr_send(&a

Re: [Qemu-devel] [PATCH v2 1/4] dump: add DumpInfo structure

2017-06-04 Thread Zhang Chen
also propose myself to help with reviews. Wen or Laszla, do you want to be the main maintainer? I can cc Qiao Nuohan... Thanks Zhang Chen (sorry for the typo) or rather "Supported" ("Someone is actually paid to look after this" according to MAINTAINERS) Thanks, but I d

[Qemu-devel] [PATCH V3 3/3] COLO-compare: Add remote initialization and checkpoint notification

2017-06-06 Thread Zhang Chen
Initialize remote communication socket and make a handshack with remote colo-frame. Then use this way to notify remote colo-frame do checkpoint. Signed-off-by: Zhang Chen --- net/colo-compare.c | 32 1 file changed, 32 insertions(+) diff --git a/net/colo

[Qemu-devel] [PATCH V3 2/3] COLO-compare: Add remote checkpoint notify chardev socket handler frame

2017-06-06 Thread Zhang Chen
Add chardev handler to get remote colo-frame's notify, Xen colo is the first user. Signed-off-by: Zhang Chen --- net/colo-compare.c | 39 +-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 6f

[Qemu-devel] [PATCH V3 0/3] COLO-compare: Make COLO-compare support remote COLO-frame

2017-06-06 Thread Zhang Chen
-devel/2017-04/msg03904.html I will send another part of this series after depend patchset have been merged. V3: - Fix codestyle. V2: - Rename this series. - Change communication way to remote colo-frame. - Some bugfix. - Split the main function, anther part wait depend patchset. Zhang Chen

[Qemu-devel] [PATCH V3 1/3] COLO-compare: Add new parameter for communicate with remote colo-frame

2017-06-06 Thread Zhang Chen
We add the "notify_dev=chardevID" parameter. colo-compare can connect with remote colo-frame through chardev socket, Xen colo-frame is the first user. We can notify colo-frame do checkpoint events. Signed-off-by: Zhang Chen --- net/colo-compare.c | 20 qemu-

[Qemu-devel] [PATCH V6 04/10] net/net.c: Add vnet_hdr support in SocketReadState

2017-06-07 Thread Zhang Chen
We add a flag to dicide whether net_fill_rstate() to read the vnet_hdr_len or not. Signed-off-by: Zhang Chen Suggested-by: Jason Wang --- include/net/net.h | 6 +- net/filter-mirror.c | 1 + net/net.c | 33 ++--- 3 files changed, 36 insertions

[Qemu-devel] [PATCH V6 01/10] net: Add vnet_hdr_len arguments in NetClientState

2017-06-07 Thread Zhang Chen
Add vnet_hdr_len arguments in NetClientState that make other module get real vnet_hdr_len easily. Signed-off-by: Zhang Chen --- include/net/net.h | 1 + net/net.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/net/net.h b/include/net/net.h index 99b28d5..9a92c70 100644

[Qemu-devel] [PATCH V6 05/10] net/colo.c: Make vnet_hdr_len as packet property

2017-06-07 Thread Zhang Chen
We can use this property flush and send packet with vnet_hdr_len. Signed-off-by: Zhang Chen --- net/colo-compare.c| 8 ++-- net/colo.c| 3 ++- net/colo.h| 4 +++- net/filter-rewriter.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/net

[Qemu-devel] [PATCH V6 08/10] net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare

2017-06-07 Thread Zhang Chen
COLO-Proxy just focus on packet payload, So we skip vnet header. Signed-off-by: Zhang Chen --- net/colo-compare.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index e33cf7e..ad1c3d5 100644 --- a/net/colo-compare.c +++ b/net

[Qemu-devel] [PATCH V6 02/10] net/filter-mirror.c: Make filter mirror support vnet support.

2017-06-07 Thread Zhang Chen
packet format from struct {int size; const uint8_t buf[];} to {int size; int vnet_hdr_len; const uint8_t buf[];}. make other module(like colo-compare) know how to parse net packet correctly. Signed-off-by: Zhang Chen --- net/filter-mirror.c | 69

[Qemu-devel] [PATCH V6 00/10] Add COLO-proxy virtio-net support

2017-06-07 Thread Zhang Chen
rewriter. - Add filter-rewriter virtio-net support. - Address other comments. Zhang Chen (10): net: Add vnet_hdr_len arguments in NetClientState net/filter-mirror.c: Make filter mirror support vnet support. net/filter-mirror.c: Add new option to enable vnet support for filter-redirector

[Qemu-devel] [PATCH V6 10/10] docs/colo-proxy.txt: Update colo-proxy usage of net driver with vnet_header

2017-06-07 Thread Zhang Chen
Signed-off-by: Zhang Chen --- docs/colo-proxy.txt | 26 ++ 1 file changed, 26 insertions(+) diff --git a/docs/colo-proxy.txt b/docs/colo-proxy.txt index c4941de..f6a624f 100644 --- a/docs/colo-proxy.txt +++ b/docs/colo-proxy.txt @@ -182,6 +182,32 @@ Secondary(ip:3.3.3.8

[Qemu-devel] [PATCH V6 09/10] net/filter-rewriter.c: Make filter-rewriter support vnet_hdr_len

2017-06-07 Thread Zhang Chen
packet correctly. Signed-off-by: Zhang Chen --- net/filter-rewriter.c | 51 ++- qemu-options.hx | 4 ++-- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index 63256c7..8eaf0e8

[Qemu-devel] [PATCH V6 03/10] net/filter-mirror.c: Add new option to enable vnet support for filter-redirector

2017-06-07 Thread Zhang Chen
filter-redirector,id=r0,netdev=hn0,queue=tx,outdev=red0,vnet_hdr_support Signed-off-by: Zhang Chen --- net/filter-mirror.c | 28 qemu-options.hx | 6 +++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c

[Qemu-devel] [PATCH V6 07/10] net/colo.c: Add vnet packet parse feature in colo-proxy

2017-06-07 Thread Zhang Chen
Make colo-compare and filter-rewriter can parse vnet packet. Signed-off-by: Zhang Chen --- net/colo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/colo.c b/net/colo.c index 180eaed..28ce7c8 100644 --- a/net/colo.c +++ b/net/colo.c @@ -43,11 +43,11 @@ int

[Qemu-devel] [PATCH V6 06/10] net/colo-compare.c: Make colo-compare support vnet_hdr_len

2017-06-07 Thread Zhang Chen
-compare can get vnet header length from filter, Add vnet_hdr_len to struct packet and output packet with the vnet_hdr_len. Signed-off-by: Zhang Chen --- net/colo-compare.c | 70 +++--- qemu-options.hx| 4 ++-- 2 files changed, 63 insertions(+), 11

<    2   3   4   5   6   7   8   9   10   11   >