aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_flow_table_core.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-01-06 12:56:47 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-01-16 15:51:52 +0100
commitf698fe40829b21088d323c8b0a7c626571528fc6 (patch)
tree5fee556023e5b2b8855a1ab7ee57a12da7a10bb2 /net/netfilter/nf_flow_table_core.c
parenta5449cdcaac5c78d62b8bea8f79158071f23da01 (diff)
downloadlinux-f698fe40829b21088d323c8b0a7c626571528fc6.tar.gz
netfilter: flowtable: refresh flow if hardware offload fails
If nf_flow_offload_add() fails to add the flow to hardware, then the NF_FLOW_HW_REFRESH flag bit is set and the flow remains in the flowtable software path. If flowtable hardware offload is enabled, this patch enqueues a new request to offload this flow to hardware. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_flow_table_core.c')
-rw-r--r--net/netfilter/nf_flow_table_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index e919bafd68d1fb..7e91989a1b55be 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -243,8 +243,10 @@ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
return err;
}
- if (nf_flowtable_hw_offload(flow_table))
+ if (nf_flowtable_hw_offload(flow_table)) {
+ __set_bit(NF_FLOW_HW, &flow->flags);
nf_flow_offload_add(flow_table, flow);
+ }
return 0;
}