* [PATCH nft 1/2] mnl: do not set flowtable flags twice
@ 2021-03-31 14:15 Pablo Neira Ayuso
2021-03-31 14:15 ` [PATCH nft 2/2] parser_bison: simplify flowtable offload flag parser Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2021-03-31 14:15 UTC (permalink / raw)
To: netfilter-devel
Flags are already set on from mnl_nft_flowtable_add(), remove duplicated
code.
Fixes: e6cc9f37385 ("nftables: add flags offload to flowtable")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/mnl.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/mnl.c b/src/mnl.c
index ffbfe48158de..deea586f9b00 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -1779,11 +1779,6 @@ int mnl_nft_flowtable_add(struct netlink_ctx *ctx, struct cmd *cmd,
nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_PRIO, 0);
}
- if (cmd->flowtable->flags & FLOWTABLE_F_HW_OFFLOAD) {
- nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_FLAGS,
- NFT_FLOWTABLE_HW_OFFLOAD);
- }
-
if (cmd->flowtable->dev_expr) {
dev_array = nft_flowtable_dev_array(cmd);
nftnl_flowtable_set_data(flo, NFTNL_FLOWTABLE_DEVICES,
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH nft 2/2] parser_bison: simplify flowtable offload flag parser
2021-03-31 14:15 [PATCH nft 1/2] mnl: do not set flowtable flags twice Pablo Neira Ayuso
@ 2021-03-31 14:15 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2021-03-31 14:15 UTC (permalink / raw)
To: netfilter-devel
Remove ft_flags_spec rule.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/parser_bison.y | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/parser_bison.y b/src/parser_bison.y
index abe117814db0..cc477e65672a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1996,7 +1996,6 @@ flowtable_block_alloc : /* empty */
flowtable_block : /* empty */ { $$ = $<flowtable>-1; }
| flowtable_block common_block
| flowtable_block stmt_separator
- | flowtable_block ft_flags_spec stmt_separator
| flowtable_block HOOK STRING prio_spec stmt_separator
{
$$->hook.loc = @3;
@@ -2019,6 +2018,10 @@ flowtable_block : /* empty */ { $$ = $<flowtable>-1; }
{
$$->flags |= NFT_FLOWTABLE_COUNTER;
}
+ | flowtable_block FLAGS OFFLOAD stmt_separator
+ {
+ $$->flags |= FLOWTABLE_F_HW_OFFLOAD;
+ }
;
flowtable_expr : '{' flowtable_list_expr '}'
@@ -2379,12 +2382,6 @@ flags_spec : FLAGS OFFLOAD
}
;
-ft_flags_spec : FLAGS OFFLOAD
- {
- $<flowtable>0->flags |= FLOWTABLE_F_HW_OFFLOAD;
- }
- ;
-
policy_spec : POLICY policy_expr
{
if ($<chain>0->policy) {
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-31 14:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31 14:15 [PATCH nft 1/2] mnl: do not set flowtable flags twice Pablo Neira Ayuso
2021-03-31 14:15 ` [PATCH nft 2/2] parser_bison: simplify flowtable offload flag parser Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).