diff options
author | Tonghao Zhang <xiangxia.m.yue@gmail.com> | 2020-08-12 11:56:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-14 00:53:30 +0200 |
commit | 1f3a090b9033f69de380c03db3ea1a1015c850cf (patch) | |
tree | 0643c4fad96851def0045117bee2dc4fe89ff94a /net/openvswitch/flow_table.h | |
parent | af_packet: TPACKET_V3: fix fill status rwlock imbalance (diff) | |
download | linux-1f3a090b9033f69de380c03db3ea1a1015c850cf.tar.xz linux-1f3a090b9033f69de380c03db3ea1a1015c850cf.zip |
net: openvswitch: introduce common code for flushing flows
To avoid some issues, for example RCU usage warning and double free,
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.
Fixes: 50b0e61b32ee ("net: openvswitch: fix possible memleak on destroy flow-table")
Reported-by: Johan Knöös <jknoos@google.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2020-August/050489.html
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow_table.h')
-rw-r--r-- | net/openvswitch/flow_table.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/openvswitch/flow_table.h b/net/openvswitch/flow_table.h index 74ce48fecba9..6e7d4ac59353 100644 --- a/net/openvswitch/flow_table.h +++ b/net/openvswitch/flow_table.h @@ -105,5 +105,8 @@ void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src, bool full, const struct sw_flow_mask *mask); void ovs_flow_masks_rebalance(struct flow_table *table); +void table_instance_flow_flush(struct flow_table *table, + struct table_instance *ti, + struct table_instance *ufid_ti); #endif /* flow_table.h */ |