]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: use new transaction infrastructure to handle sets
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Apr 2014 09:48:44 +0000 (11:48 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 19 May 2014 10:06:10 +0000 (12:06 +0200)
commitdc63100f750d4a04b74b9a5ed7901c68fceafef9
tree608d1ca657f8d5b23524b6c655734f401d9a7a84
parentb9ecb13aeec835f91f6c02a5603a11cf856f5a86
netfilter: nf_tables: use new transaction infrastructure to handle sets

This patch reworks the nf_tables API so set updates are included in
the same batch that contains rule updates. This speeds up rule-set
updates since we skip a dialog of four messages between kernel and
user-space (two on each direction), from:

 1) create the set and send netlink message to the kernel
 2) process the response from the kernel that contains the allocated name.
 3) add the set elements and send netlink message to the kernel.
 4) process the response from the kernel (to check for errors).

To:

 1) add the set to the batch.
 2) add the set elements to the batch.
 3) add the rule that points to the set.
 4) send batch to the kernel.

This also introduces an internal set ID (NFTA_SET_ID) that is unique
in the batch so set elements and rules can refer to new sets.

Backward compatibility has been only retained in userspace, this
means that new nft versions can talk to the kernel both in the new
and the old fashion.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_lookup.c