The layering between ofproto and ovs-vswitchd caused the datapath ID to be
logged in a needlessly confusing way. First, ofproto would log its
default datapath ID:
using datapath ID
0000505400000004
then the bridge code would immediately determine the datapath ID that it
wanted and call ofproto_set_datapath_id(), which would log the change
datapath ID changed to
0000111122223333
This commit stops logging the default datapath ID, which is never actually
visible in OpenFlow. This should make the log files easier to understand.
Bug #12164.
Reported-by: Jacob Cherkas <jcherkas@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
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;
}
}
+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);
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);
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);