From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHtiG-0002Gh-Sh for qemu-devel@nongnu.org; Wed, 22 Jul 2015 09:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHtiD-0006xP-DL for qemu-devel@nongnu.org; Wed, 22 Jul 2015 09:05:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHtiD-0006xL-94 for qemu-devel@nongnu.org; Wed, 22 Jul 2015 09:05:29 -0400 Message-ID: <55AF9515.3030600@redhat.com> Date: Wed, 22 Jul 2015 15:05:25 +0200 From: Thomas Huth MIME-Version: 1.0 References: <55AF75E6.6070909@cn.fujitsu.com> <1437562536-20414-1-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1437562536-20414-1-git-send-email-yanghy@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] RFC/net: Add a net filter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang , qemu-devel@nongnu.org Cc: jasowang@redhat.com, stefanha@redhat.com On 22/07/15 12:55, Yang Hongyang wrote: > This patch add a net filter between network backend and NIC devices. > All packets will pass by this filter. > TODO: > multiqueue support. > plugin support. >=20 > +--------------+ +-------------+ > +----------+ | filter | |frontend(NIC)| > | real | | | | | > | network <--+backend <-------+ | > | backend | | peer +-------> peer | > +----------+ +--------------+ +-------------+ >=20 > Usage: > -netdev tap,id=3Dbn0 # you can use whatever backend as needed > -netdev filter,id=3Df0,backend=3Dbn0,plugin=3Ddump > -device e1000,netdev=3Df0 That's basically a neat idea... however, one question remains: Will there be other filters beside the "dump" filter that you mentioned in your example? Do you already have something in mind? If not, I think this is likely not worth the effort - and we likely should keep it simple and implement the dump option as suggested with my patches instead. > diff --git a/net/filter.c b/net/filter.c > new file mode 100644 > index 0000000..006c64a > --- /dev/null > +++ b/net/filter.c > @@ -0,0 +1,200 @@ > +/* > + * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (C= OLO) > + * (a.k.a. Fault Tolerance or Continuous Replication) This looks like a bad copy-n-paste comment... ? > + * Copyright (c) 2015 HUAWEI TECHNOLOGIES CO., LTD. > + * Copyright (c) 2015 FUJITSU LIMITED > + * Copyright (c) 2015 Intel Corporation > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or > + * later. See the COPYING file in the top-level directory. > + */ ... Thomas