From d42bd56cff1a22301703d2b9d6d6fc937ea7cfbd Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 3 Mar 2020 13:14:59 +0100 Subject: src: support for offload chain flag This patch extends the basechain definition to allow users to specify the offload flag. This flag enables hardware offload if your drivers supports it. # cat file.nft table netdev x { chain y { type filter hook ingress device eth0 priority 10; flags offload; } } # nft -f file.nft Note: You have to enable offload via ethtool: # ethtool -K eth0 hw-tc-offload on Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 4c27fcc6..b37e9e56 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1667,6 +1667,7 @@ chain_block : /* empty */ { $$ = $-1; } | chain_block stmt_separator | chain_block hook_spec stmt_separator | chain_block policy_spec stmt_separator + | chain_block flags_spec stmt_separator | chain_block rule stmt_separator { list_add_tail(&$2->list, &$1->rules); @@ -2154,6 +2155,12 @@ dev_spec : DEVICE string | /* empty */ { $$ = NULL; } ; +flags_spec : FLAGS OFFLOAD + { + $0->flags |= CHAIN_F_HW_OFFLOAD; + } + ; + policy_spec : POLICY policy_expr { if ($0->policy) { -- cgit v1.2.3