Skip to contentSkip to conversation

netfilter: nfqueue: batch verdict support

PATCH Applied Florian Westphal 2 participants 2 messages Jul 18, 2011 – Jul 19, 2011

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH v2 1/1 netfilter: nfqueue: batch verdict support

Introduces a new nfnetlink type that applies a given verdict to all queued packets with an id <= the id in the verdict message.

If a mark is provided it is applied to all matched packets.

This reduces the number of verdicts that have to be sent. Applications that make use of this feature need to maintain a timeout to send a batchverdict periodically to avoid starvation.

---
This patch depends on 'netfilter: nfqueue: assert monotonic packet ids' from Eric Dumazet.

batch hook has been converted to call_rcu, all rcu read locks have thus been removed.

 include/linux/netfilter/nfnetlink_queue.h |    1 +
 net/netfilter/nfnetlink_queue.c           |  115 ++++++++++++++++++++++++++---
 2 files changed, 104 insertions(+), 12 deletions(-)
include/linux/netfilter/nfnetlink_queue.h +1 -0
index af94e00..24b32e6 100644
@@ -8,6 +8,7 @@ enum nfqnl_msg_types {
 	NFQNL_MSG_PACKET,		/* packet from kernel to userspace */
 	NFQNL_MSG_VERDICT,		/* verdict from userspace to kernel */
 	NFQNL_MSG_CONFIG,		/* connect to a particular queue */
+	NFQNL_MSG_VERDICT_BATCH,	/* batchv from userspace to kernel */
 
 	NFQNL_MSG_MAX
 };
net/netfilter/nfnetlink_queue.c +103 -12

151 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 11 lines · Florian Westphal

Introduces a new nfnetlink type that applies a given verdict to all queued packets with an id <= the id in the verdict message.

If a mark is provided it is applied to all matched packets.

This reduces the number of verdicts that have to be sent. Applications that make use of this feature need to maintain a timeout to send a batchverdict periodically to avoid starvation.

Applied, thanks Florian.