From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJiG4-0002fa-Ne for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJiG0-00062A-8R for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:15:56 -0400 Received: from [59.151.112.132] (port=38052 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJiFy-0005xb-KO for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:15:52 -0400 Message-ID: <55B62EF0.9040408@cn.fujitsu.com> Date: Mon, 27 Jul 2015 21:15:28 +0800 From: Yang Hongyang 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> <55B62638.7000201@redhat.com> In-Reply-To: <55B62638.7000201@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed 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: Thomas Huth , qemu-devel@nongnu.org Cc: jasowang@redhat.com, mrhines@linux.vnet.ibm.com, stefanha@redhat.com On 07/27/2015 08:38 PM, Thomas Huth wrote: > 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 Sorry for not done so this time, will check next time. Thank you! > > Thomas > > > . > -- Thanks, Yang.