netfilter: nf_tables: add optimized data comparison for small values

Add an optimized version of nft_data_cmp() that only handles values of to
4 bytes length.

This patch includes original Patrick McHardy's patch entitled (nf_tables:
inline nft_cmp_fast_eval() into main evaluation loop).

Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
Patrick McHardy 2013-10-10 23:35:40 +02:00 • committed by Pablo Neira Ayuso
commit cb7dbfd039
3 changed files with 118 additions and 24 deletions

View file

@ -7,6 +7,14 @@ extern void nf_tables_core_module_exit(void);
extern int nft_immediate_module_init(void);
extern void nft_immediate_module_exit(void);
struct nft_cmp_fast_expr {
u32 data;
enum nft_registers sreg:8;
u8 len;
};
extern const struct nft_expr_ops nft_cmp_fast_ops;
extern int nft_cmp_module_init(void);
extern void nft_cmp_module_exit(void);