diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 425da91c5..709713d02 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -405,8 +405,6 @@ ofproto_create(const char *datapath_name, const char *datapath_type, assert(ofproto->n_tables); ofproto->datapath_id = pick_datapath_id(ofproto); - VLOG_INFO("%s: using datapath ID %016"PRIx64, - ofproto->name, ofproto->datapath_id); init_ports(ofproto); *ofprotop = ofproto; @@ -428,15 +426,18 @@ ofproto_init_tables(struct ofproto *ofproto, int n_tables) } } +uint64_t +ofproto_get_datapath_id(const struct ofproto *ofproto) +{ + return ofproto->datapath_id; +} + void ofproto_set_datapath_id(struct ofproto *p, uint64_t datapath_id) { uint64_t old_dpid = p->datapath_id; p->datapath_id = datapath_id ? datapath_id : pick_datapath_id(p); if (p->datapath_id != old_dpid) { - VLOG_INFO("%s: datapath ID changed to %016"PRIx64, - p->name, p->datapath_id); - /* Force all active connections to reconnect, since there is no way to * notify a controller that the datapath ID has changed. */ ofproto_reconnect_controllers(p); diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index ea988e7bb..0919d813b 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -201,6 +201,7 @@ int ofproto_port_query_by_name(const struct ofproto *, const char *devname, struct ofproto_port *); /* Top-level configuration. */ +uint64_t ofproto_get_datapath_id(const struct ofproto *); void ofproto_set_datapath_id(struct ofproto *, uint64_t datapath_id); void ofproto_set_controllers(struct ofproto *, const struct ofproto_controller *, size_t n); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 67e29d2d4..3a3e58b15 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -754,7 +754,10 @@ bridge_configure_datapath_id(struct bridge *br) memcpy(br->ea, ea, ETH_ADDR_LEN); dpid = bridge_pick_datapath_id(br, ea, hw_addr_iface); - ofproto_set_datapath_id(br->ofproto, dpid); + if (dpid != ofproto_get_datapath_id(br->ofproto)) { + VLOG_INFO("bridge %s: using datapath ID %016"PRIx64, br->name, dpid); + ofproto_set_datapath_id(br->ofproto, dpid); + } dpid_string = xasprintf("%016"PRIx64, dpid); ovsrec_bridge_set_datapath_id(br->cfg, dpid_string);