From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: Thomas Huth <thuth@redhat.com>, Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org
Cc: mrhines@linux.vnet.ibm.com, zhang.zhanghailiang@huawei.com,
stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 09/12] netfilter: add a netbuffer filter
Date: Thu, 30 Jul 2015 23:00:23 +0800 [thread overview]
Message-ID: <55BA3C07.5080103@cn.fujitsu.com> (raw)
In-Reply-To: <55BA31D4.5020402@redhat.com>
On 07/30/2015 10:16 PM, Thomas Huth wrote:
> On 30/07/15 12:28, Yang Hongyang wrote:
>> On 07/30/2015 06:14 PM, Jason Wang wrote:
>>>
>>>
>>> On 07/30/2015 05:49 PM, Yang Hongyang wrote:
>>>> On 07/30/2015 05:33 PM, Jason Wang wrote:
> [...]
>>>>> I see, so the reason is you are using qemu_deliver_packet() for both
>>>>> enqueuing packet to filter and delivering packet to destination. How
>>>>> about something like:
>>>>>
>>>>> E.g for qemu_send_packet_async(), move the hook before
>>>>> qemu_send_packet_async_with_flags(). Then flush method can call
>>>>> qemu_send_packet_async_with_flags() without any issue?
>>>>
>>>> I think we can't move the hook earlier, because filters only deal
>>>> with the packets will actually been sent. for example, a dump filter.
>>>> dump packet that probably won't been sent is wrong. calling
>>>> qemu_send_packet_async() or qemu_send_packet_async_with_flags()
>>>> doesn't mean the packet is sent, if the sent_cb is not provided and
>>>> the other peer is not able to receive, the packet will be dropped.
>>>
>>> It depends on how do you define 'actually been sent' and whether or not
>>> we should have such accuracy. Packet could be dropped by various layers.
>>> Reaching receive() or receive_iov() does not mean it can be sent for
>>> sure. For example, lots of nics drop packet in their receive()
>>> implementation.
>>
>> This is true, ok, I'm convinced that we might not need to be this accurate.
>> but Thomas might have different opinion, I saw this description in his
>> dump series:
>>
>> + /*
>> + * Log network traffic into a dump file. Note: This should ideally
>> + * be done after calling the ->receive() function below to make sure
>> + * that we only log the packets that have really been sent. However,
>> + * this does not work right with slirp networking since it immediately
>> + * sends reply packets during the receive() function already, so we
>> + * would get a wrong order of the packets in the dump file in that
>> case.
>> + */
>>
>> So Thomas, what do you think of this?
>
> IMHO it should be ok if a dump captures a packet multiple times - it's
> not nice, but it could theoretically also happen on a physical line when
> a packet has to be retransmitted.
Ok, thanks! then I'll move the filter hook earlier.
>
> Thomas
>
>
> .
>
--
Thanks,
Yang.
next prev parent reply other threads:[~2015-07-30 15:00 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 10:51 [Qemu-devel] [PATCH 00/12] For QEMU 2.5: Add a netfilter object and netbuffer filter Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 01/12] net: add a new object netfilter Yang Hongyang
2015-07-29 13:53 ` Thomas Huth
2015-07-29 14:05 ` Yang Hongyang
2015-07-29 14:20 ` Thomas Huth
2015-07-29 14:32 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 02/12] init/cleanup of netfilter object Yang Hongyang
2015-07-29 13:33 ` Thomas Huth
2015-07-29 13:50 ` Yang Hongyang
2015-07-29 13:58 ` Thomas Huth
2015-07-29 14:08 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 03/12] netfilter: add netfilter_{add|del} commands Yang Hongyang
2015-07-29 14:15 ` Thomas Huth
2015-07-29 14:28 ` Yang Hongyang
2015-07-29 14:30 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 04/12] net: add/remove filters from network backend Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 05/12] netfilter: hook packets before receive Yang Hongyang
2015-07-30 4:51 ` Jason Wang
2015-07-30 7:22 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 06/12] netfilter: provide a compat receive_iov Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 07/12] net/queue: export qemu_net_queue_append Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 08/12] move out net queue structs define Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 09/12] netfilter: add a netbuffer filter Yang Hongyang
2015-07-30 1:45 ` Li Zhijian
2015-07-30 1:53 ` Yang Hongyang
2015-07-30 5:13 ` Jason Wang
2015-07-30 6:47 ` Yang Hongyang
2015-07-30 8:40 ` Jason Wang
2015-07-30 9:04 ` Yang Hongyang
2015-07-30 9:33 ` Jason Wang
2015-07-30 9:49 ` Yang Hongyang
2015-07-30 10:14 ` Jason Wang
2015-07-30 10:28 ` Yang Hongyang
2015-07-30 14:16 ` Thomas Huth
2015-07-30 15:00 ` Yang Hongyang [this message]
2015-07-30 13:46 ` Yang Hongyang
2015-07-30 7:00 ` Yang Hongyang
2015-07-30 8:52 ` Jason Wang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 10/12] netbuffer: add a public api filter_buffer_release_all Yang Hongyang
2015-07-30 5:25 ` Jason Wang
2015-07-30 5:50 ` Yang Hongyang
2015-07-30 8:42 ` Jason Wang
2015-07-30 8:53 ` Yang Hongyang
2015-07-30 8:50 ` Jason Wang
2015-07-30 9:06 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 11/12] filter/buffer: add an interval option to buffer filter Yang Hongyang
2015-07-30 5:27 ` Jason Wang
2015-07-30 5:37 ` Yang Hongyang
2015-07-30 8:53 ` Jason Wang
2015-07-30 9:12 ` Yang Hongyang
2015-07-29 10:51 ` [Qemu-devel] [PATCH 12/12] filter/buffer: update command description and help Yang Hongyang
2015-07-29 12:56 ` [Qemu-devel] [PATCH 00/12] For QEMU 2.5: Add a netfilter object and netbuffer filter Thomas Huth
2015-07-29 13:39 ` Yang Hongyang
2015-07-29 13:48 ` Thomas Huth
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=55BA3C07.5080103@cn.fujitsu.com \
--to=yanghy@cn.fujitsu.com \
--cc=jasowang@redhat.com \
--cc=mrhines@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=zhang.zhanghailiang@huawei.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).