netfilter: flowtable: set on NF_FLOW_HW once flow has been offloaded
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: flowtable: set on NF_FLOW_HW once flow has been offloaded
Sashiko reports that refreshing hw offload from packet path is racy since flow might be already going away. Since commit 7c549fb7eecd ("netfilter: flowtable: generalize pending status bit"), GC skips flow entries that are still pending to be offloaded. Set on NF_FLOW_HW flag once the flow entry has been offloaded.
Fixes 8b3646d6e0c4 ("net/sched: act_ct: Support refreshing the flow table entries")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nf_flow_table_core.c | 2 +- net/netfilter/nf_flow_table_offload.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
net/netfilter/nf_flow_table_core.c +1 -1
@@ -379,7 +379,7 @@ void flow_offload_refresh(struct nf_flowtable *flow_table, test_bit(NF_FLOW_CLOSING, &flow->flags))return ; -if (test_bit (NF_FLOW_HW , &flow->flags)) +if (!test_bit (NF_FLOW_HW , &flow->flags))nf_flow_offload_refresh (flow_table, flow); }EXPORT_SYMBOL_GPL (flow_offload_refresh);
net/netfilter/nf_flow_table_offload.c +1 -2
@@ -984,7 +984,7 @@ static void flow_offload_work_add(struct flow_offload_work *offload) goto out;set_bit (IPS_HW_OFFLOAD_BIT , &offload->flow->ct->status); - +set_bit (NF_FLOW_HW , &offload->flow->flags); out:nf_flow_offload_destroy (flow_rule); }
@@ -1129,7 +1129,6 @@ void nf_flow_offload_add(struct nf_flowtable *flowtable,if (nf_flow_offload_unsupported (flow))return ; -set_bit (NF_FLOW_HW , &flow->flags);nf_flow_offload_refresh (flowtable, flow); }
Signature · 1 line
2.47.3