On current master, the 'struct tnl_port' in tunnel module will be recreated whenever the global connectivity sequence number changes (e.g. when adding unrelated flow). This is unnecessary and could cause drop of tunnel packet if a lookup happens between the removal and recreate.
This commit fixes the above issue by only checking the netdev's own sequence number. Found by code inspection. Signed-off-by: Alex Wang <al...@nicira.com> --- ofproto/tunnel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 25df9eb..769f533 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -61,7 +61,7 @@ struct tnl_port { struct hmap_node match_node; const struct ofport_dpif *ofport; - unsigned int change_seq; + uint64_t change_seq; struct netdev *netdev; struct tnl_match match; @@ -158,7 +158,7 @@ tnl_port_add__(const struct ofport_dpif *ofport, const struct netdev *netdev, tnl_port = xzalloc(sizeof *tnl_port); tnl_port->ofport = ofport; tnl_port->netdev = netdev_ref(netdev); - tnl_port->change_seq = seq_read(connectivity_seq_get()); + tnl_port->change_seq = netdev_get_change_seq(tnl_port->netdev); tnl_port->match.in_key = cfg->in_key; tnl_port->match.ip_src = cfg->ip_src; @@ -232,7 +232,7 @@ tnl_port_reconfigure(const struct ofport_dpif *ofport, changed = tnl_port_add__(ofport, netdev, odp_port, false, native_tnl, name); } else if (tnl_port->netdev != netdev || tnl_port->match.odp_port != odp_port - || tnl_port->change_seq != seq_read(connectivity_seq_get())) { + || tnl_port->change_seq != netdev_get_change_seq(tnl_port->netdev)) { VLOG_DBG("reconfiguring %s", tnl_port_get_name(tnl_port)); tnl_port_del__(ofport); tnl_port_add__(ofport, netdev, odp_port, true, native_tnl, name); -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev