Skip to content

Commit 91bfaa1

Browse files
Paul Blakeyummakynes
authored andcommitted
netfilter: flowtable: Fix hardware flush order on nf_flow_table_cleanup
On netdev down event, nf_flow_table_cleanup() is called for the relevant device and it cleans all the tables that are on that device. If one of those tables has hardware offload flag, nf_flow_table_iterate_cleanup flushes hardware and then runs the gc. But the gc can queue more hardware work, which will take time to execute. Instead first add the work, then flush it, to execute it now. Fixes: c29f74e ("netfilter: nf_flow_table: hardware offload support") Signed-off-by: Paul Blakey <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent b9e0102 commit 91bfaa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_flow_table_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ static void nf_flow_table_do_cleanup(struct flow_offload *flow, void *data)
529529
static void nf_flow_table_iterate_cleanup(struct nf_flowtable *flowtable,
530530
struct net_device *dev)
531531
{
532-
nf_flow_table_offload_flush(flowtable);
533532
nf_flow_table_iterate(flowtable, nf_flow_table_do_cleanup, dev);
534533
flush_delayed_work(&flowtable->gc_work);
534+
nf_flow_table_offload_flush(flowtable);
535535
}
536536

537537
void nf_flow_table_cleanup(struct net_device *dev)

0 commit comments

Comments
 (0)