From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJhfk-0003mx-Rm for qemu-devel@nongnu.org; Mon, 27 Jul 2015 08:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJhfg-0003jn-MP for qemu-devel@nongnu.org; Mon, 27 Jul 2015 08:38:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJhfg-0003jL-GR for qemu-devel@nongnu.org; Mon, 27 Jul 2015 08:38:20 -0400 Message-ID: <55B62638.7000201@redhat.com> Date: Mon, 27 Jul 2015 14:38:16 +0200 From: Thomas Huth MIME-Version: 1.0 References: <1437735359-17415-1-git-send-email-yanghy@cn.fujitsu.com> <1437735359-17415-2-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1437735359-17415-2-git-send-email-yanghy@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/9] netdev: 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, mrhines@linux.vnet.ibm.com, stefanha@redhat.com On 24/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. > > +--------------+ +-------------+ > +----------+ | 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-. > A filter without plugin supplied will do nothing except pass by all > packets, a plugin like dump for example, will dump all packets into a > file. Or other plugins like a netbuffer plugin, will simply buffer the > packets, release the packets when needed. > You can also implement whatever plugin you needed based on this filter. > > Signed-off-by: Yang Hongyang Hi, just a quick comment: Please make sure to check your patches with scripts/checkpatch.pl first before sending them for review - at least for this patch, the script complains: ERROR: do not use C99 // comments #59: FILE: include/net/filter.h:12: +//#include "qapi-types.h" WARNING: braces {} are necessary for all arms of this statement #424: FILE: net/filter.c:311: + if (plug->plugin == plugin) [...] total: 1 errors, 1 warnings, 463 lines checked Thomas