From: Jesse Gross Date: Sun, 5 Dec 2010 20:16:40 +0000 (-0800) Subject: tunneling: Update port pools on config change. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6569d3f419c96b18ea81a41ed13f2306119bcc00;p=openvswitch tunneling: Update port pools on config change. We keep track of the number of tunnels using the different types of matching in order to avoid doing the lookup when there are no ports of that type. However, when updating the configuration we weren't changing the port pool counts, which could lead to incorrectly not finding a tunnel on receive. Signed-off-by: Jesse Gross --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 0faa4ec8..d8bcb0ff 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -247,6 +247,7 @@ static int add_port(struct vport *vport) err = tbl_insert(port_table, &tnl_vport->tbl_node, mutable_hash(tnl_vport->mutable)); if (err) { + (*find_port_pool(tnl_vport->mutable))--; check_table_empty(); return err; } @@ -282,7 +283,9 @@ static int move_port(struct vport *vport, struct tnl_mutable_config *new_mutable } table_updated: + (*find_port_pool(tnl_vport->mutable))--; assign_config_rcu(vport, new_mutable); + (*find_port_pool(tnl_vport->mutable))++; return 0; }