Re: [PATCH] net: openvswitch: introduce common code for flushing flows
From: Cong Wang <hidden>
Date: 2020-08-12 00:48:13
Also in:
rcu
On Mon, Aug 10, 2020 at 6:14 PM [off-list ref] wrote:
From: Tonghao Zhang <redacted> To avoid some issues, for example RCU usage warning, we should flush the flows under ovs_lock. This patch refactors table_instance_destroy and introduces table_instance_flow_flush which can be invoked by __dp_destroy or ovs_flow_tbl_flush. Signed-off-by: Tonghao Zhang <redacted>
Please add a Fixes tag here, I think it is probably your memory leak fix which introduced this issue. And a Reported-by, to give credits to bug reporters. Plus one minor issue below:
-static void table_instance_destroy(struct flow_table *table,
- struct table_instance *ti,
- struct table_instance *ufid_ti,
- bool deferred)
+/* Must be called with OVS mutex held. */
+void table_instance_flow_flush(struct flow_table *table,
+ struct table_instance *ti,
+ struct table_instance *ufid_ti)
{
int i;
- if (!ti)
- return;
-
- BUG_ON(!ufid_ti);
if (ti->keep_flows)
- goto skip_flows;
+ return;
for (i = 0; i < ti->n_buckets; i++) {
- struct sw_flow *flow;
struct hlist_head *head = &ti->buckets[i];
struct hlist_node *n;
+ struct sw_flow *flow;This is at most a coding style change, please do not mix coding style changes in bug fixes. You can always push coding style changes separately when net-next is open. Thanks.