{
struct shash_node *node;
+ fat_rwlock_init(&xlate_rwlock);
+
/* Make a local copy, since we don't own 'iface_hints' elements. */
SHASH_FOR_EACH(node, iface_hints) {
const struct iface_hint *orig_hint = node->data;
continue;
}
- ovs_rwlock_wrlock(&xlate_rwlock);
+ fat_rwlock_wrlock(&xlate_rwlock);
xlate_ofproto_set(ofproto, ofproto->up.name,
ofproto->backer->dpif, ofproto->miss_rule,
ofproto->no_packet_in_rule, ofproto->ml,
ofport->up.pp.config, ofport->up.pp.state,
ofport->is_tunnel, ofport->may_enable);
}
- ovs_rwlock_unlock(&xlate_rwlock);
+ fat_rwlock_unlock(&xlate_rwlock);
}
udpif_revalidate(backer->udpif);
struct list pins;
ofproto->backer->need_revalidate = REV_RECONFIGURE;
- ovs_rwlock_wrlock(&xlate_rwlock);
+ fat_rwlock_wrlock(&xlate_rwlock);
xlate_remove_ofproto(ofproto);
- ovs_rwlock_unlock(&xlate_rwlock);
+ fat_rwlock_unlock(&xlate_rwlock);
/* Ensure that the upcall processing threads have no remaining references
* to the ofproto or anything in it. */
const char *dp_port_name;
ofproto->backer->need_revalidate = REV_RECONFIGURE;
- ovs_rwlock_wrlock(&xlate_rwlock);
+ fat_rwlock_wrlock(&xlate_rwlock);
xlate_ofport_remove(port);
- ovs_rwlock_unlock(&xlate_rwlock);
+ fat_rwlock_unlock(&xlate_rwlock);
dp_port_name = netdev_vport_get_dpif_port(port->up.netdev, namebuf,
sizeof namebuf);
set_cfm(struct ofport *ofport_, const struct cfm_settings *s)
{
struct ofport_dpif *ofport = ofport_dpif_cast(ofport_);
+ struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto);
+ struct cfm *old = ofport->cfm;
int error = 0;
if (s) {
if (!ofport->cfm) {
- struct ofproto_dpif *ofproto;
-
- ofproto = ofproto_dpif_cast(ofport->up.ofproto);
- ofproto->backer->need_revalidate = REV_RECONFIGURE;
ofport->cfm = cfm_create(ofport->up.netdev);
}
cfm_unref(ofport->cfm);
ofport->cfm = NULL;
out:
+ if (ofport->cfm != old) {
+ ofproto->backer->need_revalidate = REV_RECONFIGURE;
+ }
ofproto_dpif_monitor_port_update(ofport, ofport->bfd, ofport->cfm,
ofport->up.pp.hw_addr);
return error;
ofproto = bundle->ofproto;
mbridge_unregister_bundle(ofproto->mbridge, bundle);
- ovs_rwlock_wrlock(&xlate_rwlock);
+ fat_rwlock_wrlock(&xlate_rwlock);
xlate_bundle_remove(bundle);
- ovs_rwlock_unlock(&xlate_rwlock);
+ fat_rwlock_unlock(&xlate_rwlock);
LIST_FOR_EACH_SAFE (port, next_port, bundle_node, &bundle->ports) {
bundle_del_port(port);