All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@cn.fujitsu.com>
To: Jason Wang <jasowang@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Cc: Gui jianfeng <guijianfeng@cn.fujitsu.com>,
	Yang Hongyang <hongyang.yang@easystack.cn>,
	"eddie.dong" <eddie.dong@intel.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	qemu devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization
Date: Fri, 1 Apr 2016 13:41:36 +0800	[thread overview]
Message-ID: <56FE0A10.3010108@cn.fujitsu.com> (raw)
In-Reply-To: <56FE02E5.8010305@redhat.com>



On 04/01/2016 01:11 PM, Jason Wang wrote:
>
>
> On 03/31/2016 05:24 PM, Dr. David Alan Gilbert wrote:
>> * Zhang Chen (zhangchen.fnst@cn.fujitsu.com) wrote:
>>>
>>> On 03/30/2016 05:25 PM, Dr. David Alan Gilbert wrote:
>>>> * Zhang Chen (zhangchen.fnst@cn.fujitsu.com) wrote:
>>>>> packet come from primary char indev will be send to
>>>>> outdev - packet come from secondary char dev will be drop
>>>> Please put in the description an example of how you invoke
>>>> the filter on the primary and secondary.
>>> OK.
>>> colo-compare get packet from chardev(primary_in,secondary_in),
>>> and output to other chardev(outdev), so, we can use it with the
>>> help of filter-mirror and filter-redirector. like that:
>> Wow, this is a bit more complicated than I expected - I was expecting just one
>> socket.  So let me draw this out; see comments below.
>>
>>> primary:
>>> -netdev
>>> tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
>>> -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
>>> -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
>>> -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
>>> -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
>>> -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
>>> -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
>>> -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
>>> -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
>>> -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
>>> -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
>>> -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
>>              ----> mirror0: socket:secondary:9003
>>              |
>>          mirror-m0     <-- e1000
>>              |
>>              v
>>          redirector-redire1 ---> compare0 socket:primary:9001 (to compare0-0)
>>
>>              -----< compare0-0 socket:primary:9001 (to compare0)
>>              |  primary_in
>>              |
>>          compare-comp0       -----> compare_out0 socket:primary:9005
>>              |
>>              |  secondary_in
>>              -----< compare1   socket:secondary:9004
>>
>> tap <-- redirector-redire0 <--- compare_out socket:primary:9005 (from compare_out0)
>>
>>
>>> secondary:
>>> -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down
>>> script=/etc/qemu-ifdown
>>> -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
>>> -chardev socket,id=red0,host=3.3.3.3,port=9003
>>> -chardev socket,id=red1,host=3.3.3.3,port=9004
>>> -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
>>> -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
>>              ----> red0 socket::9003
>>              |
>> tap <-- redirector-f1 <--
>>                             e1000
>>      --> redirector-f2 -->
>>              |
>>              ----< red1 socket::9004
>>
>> OK, so I think we need to find a way to fix two things:
>>     a) There must be an easier way of connecting two filters within the same
>>        qemu than going up to the kernel's socket code, around it's TCP stack
>>        and back.  Is there a better type of chardev to use we can short circuit
>>        with - it shouldn't need to leave QEMU (although I can see it's easier
>>        for debugging like this).  Jason/Dan - any ideas?
>
> Looks like there's no such type of chardev. I think we could start with
> tcp socket chardev first and do necessary optimization on top. In fact,
> there's also advantages, with tcp sockets, the colo-compare codes could
> even be an independent program out of qemu.
>
> For the chardev type, this also reminds me one thing. Since
> mirror/redirector can only work for tcp socket, we may need inspect the
> chardev types and fail if not a tcp socket like what vhost-user did.
>
>
>>
>>     b) We should only need one socket for the connection between primary and
>>        secondary - I'm not sure how to change it to let it do that.
>
> Looks like we can (e.g for secondary):
>
> -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
> -chardev socket,id=red0,host=3.3.3.3,port=9003
> -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
> -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red0
>
> If not, probably a bug.

Right,
but firstly, 'chardev socket' need to enable 'mux=on' if we want two filter reference the
same socket.

Thanks

>
>>     c) You need to be able to turn off nagling (socket no delay) on the sockets;
>>       I found a noticeable benefit of doing this on the connection between primary
>>       and secondary in my world.
>
> Right.
>
>>
>> Dave
>>
>
>
>
>
> .
>

  reply	other threads:[~2016-04-01  5:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30  8:35 [Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare Zhang Chen
2016-03-30  8:35 ` [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization Zhang Chen
2016-03-30  9:25   ` Dr. David Alan Gilbert
2016-03-31  1:41     ` Zhang Chen
2016-03-31  7:25       ` Zhang Chen
2016-03-31  9:24       ` Dr. David Alan Gilbert
2016-04-01  5:11         ` Jason Wang
2016-04-01  5:41           ` Li Zhijian [this message]
2016-04-13  2:02     ` Zhang Chen
2016-03-30  8:35 ` [Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet Zhang Chen
2016-03-30 10:36   ` Dr. David Alan Gilbert
2016-03-31  2:09     ` Li Zhijian
2016-03-31  8:47       ` Dr. David Alan Gilbert
2016-03-31  4:06     ` Zhang Chen
2016-03-31  4:23       ` Li Zhijian
2016-03-31  4:44         ` Zhang Chen
2016-03-30  8:35 ` [Qemu-devel] [PATCH V2 3/3] colo-compare: introduce packet comparison thread Zhang Chen
2016-03-30 11:41   ` Dr. David Alan Gilbert
2016-03-31  2:17     ` Li Zhijian
2016-03-31  8:50       ` Dr. David Alan Gilbert
2016-03-31  6:00     ` Zhang Chen
2016-03-30 12:05 ` [Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare Dr. David Alan Gilbert
2016-03-31  3:01   ` Li Zhijian
2016-03-31  9:43     ` Dr. David Alan Gilbert
2016-04-01  1:40       ` Li Zhijian
2016-03-31  6:48   ` Zhang Chen

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=56FE0A10.3010108@cn.fujitsu.com \
    --to=lizhijian@cn.fujitsu.com \
    --cc=dgilbert@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=hongyang.yang@easystack.cn \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhangchen.fnst@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.