Received: from eggs.gnu.org ([2001:4830:134:3::10]:49099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJaY9-0006AE-R0 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 01:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJaY4-0007Dq-Om for qemu-devel@nongnu.org; Mon, 27 Jul 2015 01:02:05 -0400 Received: from [59.151.112.132] (port=11632 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJaY3-00077F-7n for qemu-devel@nongnu.org; Mon, 27 Jul 2015 01:02:00 -0400 Message-ID: <55B5BB2D.3010405@cn.fujitsu.com> Date: Mon, 27 Jul 2015 13:01:33 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1437735359-17415-1-git-send-email-yanghy@cn.fujitsu.com> <55B5B94C.8020402@redhat.com> In-Reply-To: <55B5B94C.8020402@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/9] For QEMU 2.5: Add a net filter and a netbuffer plugin based on the filter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu-devel@nongnu.org Cc: thuth@redhat.com, mrhines@linux.vnet.ibm.com, stefanha@redhat.com On 07/27/2015 12:53 PM, Jason Wang wrote: > > > On 07/24/2015 06:55 PM, Yang Hongyang wrote: >> This patch add a net filter between network backend and NIC devices. >> All packets will pass by this filter. >> Also implement a netbuffer plugin for example, the netbuffer plugin >> could be used by VM FT solutions like Macrocheckpointing, >> to buffer/release packets. >> Based on this, dump plugin could be easily implemented. >> >> I've done some simple tests on this series, >> backend, tap,user >> NIC, e1000,virtio-net >> >> There's still some missing functions to be done, I've posted this >> early in order to gain more comments, thank you! >> >> TODO: >> multiqueue support. >> >> +--------------+ +-------------+ >> +----------+ | filter | |frontend(NIC)| >> | peer+--> | | | >> | network <--+backend <-------+ peer | >> | backend | | peer +-------> | >> +----------+ +--------------+ +-------------+ >> >> Usage: >> -netdev tap,id=bn0 # you can use whatever backend as needed >> -netdev filter,id=f0,backend=bn0 >> -netdev filter-,id=p0,filter=f0 >> -device e1000,netdev=f0 >> NOTE: >> You can attach multiple plugins to the filter, dynamically add/remove >> filter and filter-. >> >> The netbuffer plugin: >> Usage: >> -netdev tap,id=bn0 # you can use whatever backend as needed >> -netdev filter,id=f0,backend=bn0 >> -netdev filter-buffer,id=p0,filter=f0 >> -device e1000,netdev=f0 >> >> Will supply a public API to release the buffer. But there's no >> callers currently. >> To test this feature, it's quite simple, just use >> netdev_add filter-buffer,id=p0,filter=f0 >> to buffer packets, >> netdev_del p0 >> will release packets. >> >> You can also implement whatever plugin you needed based on this filter. >> >> Yang Hongyang (9): >> netdev: Add a net filter >> virtio-net: add filter support >> filter: remove plugins when remove filter >> filter: remove filter before remove network backend >> filter: add netbuffer plugin >> introduce qemu_find_net_clients_by_model >> net/queue: export qemu_net_queue_append >> move out net queue structs define >> add a public api to release buffer >> >> hw/net/virtio-net.c | 17 ++- >> include/net/filter.h | 21 ++++ >> include/net/net.h | 5 + >> include/net/queue.h | 26 ++++ >> net/Makefile.objs | 2 + >> net/clients.h | 6 + >> net/filter-buffer.c | 185 ++++++++++++++++++++++++++++ >> net/filter.c | 331 +++++++++++++++++++++++++++++++++++++++++++++++++++ >> net/net.c | 51 +++++++- >> net/queue.c | 31 +---- >> qapi-schema.json | 40 ++++++- >> 11 files changed, 679 insertions(+), 36 deletions(-) >> create mode 100644 include/net/filter.h >> create mode 100644 net/filter-buffer.c >> create mode 100644 net/filter.c >> > > Hi: > > Can you answer my question at > http://lists.gnu.org/archive/html/qemu-devel/2015-07/msg04653.html? > > The main concern is why it must be a new kind of netdev? Sorry, I missed that one... will reply in that thread. > > Thanks > . > -- Thanks, Yang.