From 6cf0f2c17bfb96c05dd0c03e0b91a75d732917cf Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 15 Jun 2021 14:57:08 +0200 Subject: src: queue: allow use of arbitrary queue expressions back in 2016 Liping Zhang added support to kernel and libnftnl to specify a source register containing the queue number to use. This was never added to nft itself, so allow this. On linearization side, check if attached expression is a range. If its not, allocate a new register and set NFTNL_EXPR_QUEUE_SREG_QNUM attribute after generating the lowlevel expressions for the kernel. On delinarization we need to check for presence of NFTNL_EXPR_QUEUE_SREG_QNUM and decode the expression(s) when present. Also need to do postprocessing for STMT_QUEUE so that the protocol context is set correctly, without this only raw payload expressions will be shown (@nh,32,...) instead of 'ip ...'. Next patch adds test cases. Signed-off-by: Florian Westphal --- doc/statements.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/statements.txt') diff --git a/doc/statements.txt b/doc/statements.txt index 602a5b20..c2a61659 100644 --- a/doc/statements.txt +++ b/doc/statements.txt @@ -591,11 +591,15 @@ for details. ____ *queue* [*flags* 'QUEUE_FLAGS'] [*num* 'queue_number'] *queue* [*flags* 'QUEUE_FLAGS'] [*num* 'queue_number_from' - 'queue_number_to'] +*queue* [*flags* 'QUEUE_FLAGS'] [*to* 'QUEUE_EXPRESSION' ] 'QUEUE_FLAGS' := 'QUEUE_FLAG' [*,* 'QUEUE_FLAGS'] 'QUEUE_FLAG' := *bypass* | *fanout* +'QUEUE_EXPRESSION' := *numgen* | *hash* | *symhash* ____ +QUEUE_EXPRESSION can be used to compute a queue number +at run-time with the hash or numgen expressions. .queue statement values [options="header"] -- cgit v1.2.3