netfilter: flowtable: Fix missing flush hardware on table free
authorPaul Blakey <paulb@mellanox.com>
Thu, 30 Jan 2020 16:04:36 +0000 (18:04 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 31 Jan 2020 18:31:41 +0000 (19:31 +0100)
If entries exist when freeing a hardware offload enabled table,
we queue work for hardware while running the gc iteration.

Execute it (flush) after queueing.

Fixes: c29f74e0df7a ("netfilter: nf_flow_table: hardware offload support")
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_core.c

index 14a069c..8af28e1 100644 (file)
@@ -553,6 +553,7 @@ void nf_flow_table_free(struct nf_flowtable *flow_table)
        cancel_delayed_work_sync(&flow_table->gc_work);
        nf_flow_table_iterate(flow_table, nf_flow_table_do_cleanup, NULL);
        nf_flow_table_iterate(flow_table, nf_flow_offload_gc_step, flow_table);
+       nf_flow_table_offload_flush(flow_table);
        rhashtable_destroy(&flow_table->rhashtable);
 }
 EXPORT_SYMBOL_GPL(nf_flow_table_free);