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-<plugin>,id=p0,filter=f0
> -device e1000,netdev=f0
> NOTE:
> You can attach multiple plugins to the filter, dynamically add/remove
> filter and filter-<plugin>.
> 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 <[email protected]>
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