qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>,
	qemu devel <qemu-devel@nongnu.org>
Cc: zhanghailiang <zhang.zhanghailiang@huawei.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>,
	weifuqiang <weifuqiang@huawei.com>,
	"eddie . dong" <eddie.dong@intel.com>,
	bian naimeng <biannm@cn.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH V3 05/10] net/net.c: Add vnet header length to SocketReadState
Date: Tue, 9 May 2017 15:36:35 +0800	[thread overview]
Message-ID: <2a94323f-89cd-586d-3ba6-5360ec26a96e@redhat.com> (raw)
In-Reply-To: <9fd0649c-caa0-9c4c-adf0-276a0ec6801f@cn.fujitsu.com>



On 2017年05月09日 14:59, Zhang Chen wrote:
>
>
> On 05/09/2017 01:36 PM, Jason Wang wrote:
>>
>>
>> On 2017年05月09日 12:03, Zhang Chen wrote:
>>>
>>>
>>> On 05/09/2017 10:40 AM, Jason Wang wrote:
>>>>
>>>>
>>>> On 2017年05月08日 11:47, Zhang Chen wrote:
>>>>>
>>>>>
>>>>> On 05/03/2017 06:42 PM, Jason Wang wrote:
>>>>>>
>>>>>>
>>>>>> On 2017年05月03日 11:43, Zhang Chen wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 05/02/2017 12:53 PM, Jason Wang wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> On 2017年04月28日 17:47, Zhang Chen wrote:
>>>>>>>>> Address Jason Wang's comments add vnet header length to 
>>>>>>>>> SocketReadState.
>>>>>>>>
>>>>>>>> Instead of saying this, you can add "Suggested-by: Jason Wang 
>>>>>>>> <jasowang@redhat.com>" above your sign-off.
>>>>>>>
>>>>>>> OK.
>>>>>>>
>>>>>>>>
>>>>>>>>> So we change net_fill_rstate() to read
>>>>>>>>> struct  {int size; int vnet_hdr_len; const uint8_t buf[];}.
>>>>>>>>
>>>>>>>> This makes me thinking about the backward compatibility. I 
>>>>>>>> think we'd better try to keep it as much as possible. E.g how 
>>>>>>>> about pack vnet_hdr_len into higher bits of size?
>>>>>>>>
>>>>>>>
>>>>>>> Do you means split uint32_t size to uint16_t size and uint16_t 
>>>>>>> vnet_hdr_len ?
>>>>>>> If yes, we also can't keep compatibility with old version.
>>>>>>> Old code send a uint32_t size, we read it as uint16_t size is 
>>>>>>> always wrong.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Zhang Chen
>>>>>>
>>>>>> Consider it's unlikely to send or receive packet >= 64K, we can 
>>>>>> reuse higher bits (e.g highest 8 bits). Then we can still read 
>>>>>> uint32_t and then check its highest 8 bits. If it was zero, we 
>>>>>> know vnet header is zero, if not it could be read as vnet header 
>>>>>> length.
>>>>>
>>>>> I got your point, but in this way, packet size must < 64K, if size 
>>>>> >=64K we still can't maintain the backward compatibility,
>>>>> For the packet sender that didn't know the potential packet size 
>>>>> limit, I think we should make code explicitly declared like
>>>>> currently code. Otherwise we will make other people confused and 
>>>>> make code difficult to maintain.
>>>>>
>>>>> Thanks
>>>>> Zhang Chen
>>>>>
>>>>
>>>> Yes, this is an possible issue in the future. Rethink about this, 
>>>> what if we just compare vnet header? Is there any issue of doing 
>>>> this? (Sorry, I remember this is a reason, but forget now).
>>>
>>> Yes, we can compare all packet with vnet header, the compare 
>>> performance is very low. but we can't parse raw packet to 
>>> tcp/udp/icmp packet, because we didn't know the vnet_hdr_len as the 
>>> offset.
>>>
>>> Thanks
>>> Zhang Chen
>>
>> Aha, so I think it's time to use the new format but:
>>
>> - probably need a new option to enable this support for filter
>
> Do you means we should add the new option for every filter object like 
> that:
> Now:
> -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
> Feature:
> -object 
> filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0,has_vnet_hdr_len=on
>
> And colo-compare also need this option to get the vnet_hdr_len.

Yes, and you can use make it short like "vnet_hdr".

>
>
>> - let's don't touch socket backend, and make it still can work with 
>> filters whose vnet_hder is off
>
> OK, Maybe we can add a new variable in net_fill_rstate().

Right.

Thanks

>
> Thanks
> Zhang Chen
>
>>
>> Thanks
>>
>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>> .
>>>>
>>>
>>
>>
>>
>> .
>>
>

  reply	other threads:[~2017-05-09  7:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  9:47 [Qemu-devel] [PATCH V3 00/10] Add COLO-proxy virtio-net support Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 01/10] net: Add vnet_hdr_len related callback in NetClientInfo Zhang Chen
2017-05-02  5:46   ` Jason Wang
2017-05-03  3:08     ` Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 02/10] net/tap.c: Add tap_get_vnet_hdr_len and tap_get_using_vnet_hdr function Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 03/10] net/netmap.c: Add netmap_get_vnet_hdr_len function Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 04/10] net/filter-mirror.c: Add filter-mirror and filter-redirector vnet support Zhang Chen
2017-05-02  5:47   ` Jason Wang
2017-05-03  3:18     ` Zhang Chen
2017-05-03 10:19       ` Jason Wang
2017-05-05  8:44         ` Zhang Chen
2017-05-05  9:25           ` Jason Wang
2017-05-05  9:43             ` Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 05/10] net/net.c: Add vnet header length to SocketReadState Zhang Chen
2017-05-02  5:53   ` Jason Wang
2017-05-03  3:43     ` Zhang Chen
2017-05-03 10:42       ` Jason Wang
2017-05-08  3:47         ` Zhang Chen
2017-05-09  2:40           ` Jason Wang
2017-05-09  4:03             ` Zhang Chen
2017-05-09  5:36               ` Jason Wang
2017-05-09  6:59                 ` Zhang Chen
2017-05-09  7:36                   ` Jason Wang [this message]
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 06/10] tests/e1000e-test.c : change e1000e test case send data format Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 07/10] tests/virtio-net-test.c : change virtio-net test case iov " Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 08/10] net/colo-compare.c: Make colo-compare support vnet_hdr_len Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 09/10] net/colo.c: Add vnet packet parse feature in colo-proxy Zhang Chen
2017-04-28  9:47 ` [Qemu-devel] [PATCH V3 10/10] net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare 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=2a94323f-89cd-586d-3ba6-5360ec26a96e@redhat.com \
    --to=jasowang@redhat.com \
    --cc=biannm@cn.fujitsu.com \
    --cc=eddie.dong@intel.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weifuqiang@huawei.com \
    --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 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).