netfilter: nfqueue: batch verdict support
Subsystems (2)
Florian Westphal
maintainerPATCH 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
@@ -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
Patrick McHardy
AppliedQuoted 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.
Signed-off-by Florian Westphal <[email protected]>
Applied, thanks Florian.