diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index d1a73a6102f8..e1b337e0bf4d 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -55,6 +55,7 @@ | |||
55 | 55 | ||
56 | #include "datapath.h" | 56 | #include "datapath.h" |
57 | #include "flow.h" | 57 | #include "flow.h" |
58 | #include "flow_table.h" | ||
58 | #include "flow_netlink.h" | 59 | #include "flow_netlink.h" |
59 | #include "vport-internal_dev.h" | 60 | #include "vport-internal_dev.h" |
60 | #include "vport-netdev.h" | 61 | #include "vport-netdev.h" |
@@ -160,7 +161,6 @@ static void destroy_dp_rcu(struct rcu_head *rcu) | |||
160 | { | 161 | { |
161 | struct datapath *dp = container_of(rcu, struct datapath, rcu); | 162 | struct datapath *dp = container_of(rcu, struct datapath, rcu); |
162 | 163 | ||
163 | ovs_flow_tbl_destroy(&dp->table); | ||
164 | free_percpu(dp->stats_percpu); | 164 | free_percpu(dp->stats_percpu); |
165 | release_net(ovs_dp_get_net(dp)); | 165 | release_net(ovs_dp_get_net(dp)); |
166 | kfree(dp->ports); | 166 | kfree(dp->ports); |
@@ -1287,7 +1287,7 @@ err_destroy_ports_array: | |||
1287 | err_destroy_percpu: | 1287 | err_destroy_percpu: |
1288 | free_percpu(dp->stats_percpu); | 1288 | free_percpu(dp->stats_percpu); |
1289 | err_destroy_table: | 1289 | err_destroy_table: |
1290 | ovs_flow_tbl_destroy(&dp->table); | 1290 | ovs_flow_tbl_destroy(&dp->table, false); |
1291 | err_free_dp: | 1291 | err_free_dp: |
1292 | release_net(ovs_dp_get_net(dp)); | 1292 | release_net(ovs_dp_get_net(dp)); |
1293 | kfree(dp); | 1293 | kfree(dp); |
@@ -1314,10 +1314,13 @@ static void __dp_destroy(struct datapath *dp) | |||
1314 | list_del_rcu(&dp->list_node); | 1314 | list_del_rcu(&dp->list_node); |
1315 | 1315 | ||
1316 | /* OVSP_LOCAL is datapath internal port. We need to make sure that | 1316 | /* OVSP_LOCAL is datapath internal port. We need to make sure that |
1317 | * all port in datapath are destroyed first before freeing datapath. | 1317 | * all ports in datapath are destroyed first before freeing datapath. |
1318 | */ | 1318 | */ |
1319 | ovs_dp_detach_port(ovs_vport_ovsl(dp, OVSP_LOCAL)); | 1319 | ovs_dp_detach_port(ovs_vport_ovsl(dp, OVSP_LOCAL)); |
1320 | 1320 | ||
1321 | /* RCU destroy the flow table */ | ||
1322 | ovs_flow_tbl_destroy(&dp->table, true); | ||
1323 | |||
1321 | call_rcu(&dp->rcu, destroy_dp_rcu); | 1324 | call_rcu(&dp->rcu, destroy_dp_rcu); |
1322 | } | 1325 | } |
1323 | 1326 | ||