@@ -685,6 +685,7 @@ local_binding_is_down(struct shash *local_bindings, const char *pb_name)
void
local_binding_set_up(struct shash *local_bindings, const char *pb_name,
+ const struct sbrec_chassis *chassis_rec,
const char *ts_now_str, bool sb_readonly,
bool ovs_readonly)
{
@@ -704,8 +705,8 @@ local_binding_set_up(struct shash *local_bindings, const char *pb_name,
ts_now_str);
}
- if (!sb_readonly && lbinding && b_lport && b_lport->pb->n_up
- && !b_lport->pb->up[0]) {
+ if (!sb_readonly && lbinding && b_lport && b_lport->pb->n_up &&
+ !b_lport->pb->up[0] && b_lport->pb->chassis == chassis_rec) {
VLOG_INFO("Setting lport %s up in Southbound", pb_name);
binding_lport_set_up(b_lport, sb_readonly);
LIST_FOR_EACH (b_lport, list_node, &lbinding->binding_lports) {
@@ -716,6 +717,7 @@ local_binding_set_up(struct shash *local_bindings, const char *pb_name,
void
local_binding_set_down(struct shash *local_bindings, const char *pb_name,
+ const struct sbrec_chassis *chassis_rec,
bool sb_readonly, bool ovs_readonly)
{
struct local_binding *lbinding =
@@ -730,7 +732,8 @@ local_binding_set_down(struct shash *local_bindings, const char *pb_name,
OVN_INSTALLED_EXT_ID);
}
- if (!sb_readonly && b_lport && b_lport->pb->n_up && b_lport->pb->up[0]) {
+ if (!sb_readonly && b_lport && b_lport->pb->n_up && b_lport->pb->up[0] &&
+ (!b_lport->pb->chassis || b_lport->pb->chassis == chassis_rec)) {
VLOG_INFO("Setting lport %s down in Southbound", pb_name);
binding_lport_set_down(b_lport, sb_readonly);
LIST_FOR_EACH (b_lport, list_node, &lbinding->binding_lports) {
@@ -154,9 +154,11 @@ ofp_port_t local_binding_get_lport_ofport(const struct shash *local_bindings,
bool local_binding_is_up(struct shash *local_bindings, const char *pb_name);
bool local_binding_is_down(struct shash *local_bindings, const char *pb_name);
void local_binding_set_up(struct shash *local_bindings, const char *pb_name,
+ const struct sbrec_chassis *chassis_rec,
const char *ts_now_str, bool sb_readonly,
bool ovs_readonly);
void local_binding_set_down(struct shash *local_bindings, const char *pb_name,
+ const struct sbrec_chassis *chassis_rec,
bool sb_readonly, bool ovs_readonly);
void binding_register_ovs_idl(struct ovsdb_idl *);
@@ -115,6 +115,7 @@ static void ovs_iface_set_state(struct if_status_mgr *, struct ovs_iface *,
static void if_status_mgr_update_bindings(
struct if_status_mgr *mgr, struct local_binding_data *binding_data,
+ const struct sbrec_chassis *,
bool sb_readonly, bool ovs_readonly);
struct if_status_mgr *
@@ -306,6 +307,7 @@ if_status_mgr_update(struct if_status_mgr *mgr,
void
if_status_mgr_run(struct if_status_mgr *mgr,
struct local_binding_data *binding_data,
+ const struct sbrec_chassis *chassis_rec,
bool sb_readonly, bool ovs_readonly)
{
struct ofctrl_acked_seqnos *acked_seqnos =
@@ -328,8 +330,8 @@ if_status_mgr_run(struct if_status_mgr *mgr,
ofctrl_acked_seqnos_destroy(acked_seqnos);
/* Update binding states. */
- if_status_mgr_update_bindings(mgr, binding_data, sb_readonly,
- ovs_readonly);
+ if_status_mgr_update_bindings(mgr, binding_data, chassis_rec,
+ sb_readonly, ovs_readonly);
}
static void
@@ -390,6 +392,7 @@ ovs_iface_set_state(struct if_status_mgr *mgr, struct ovs_iface *iface,
static void
if_status_mgr_update_bindings(struct if_status_mgr *mgr,
struct local_binding_data *binding_data,
+ const struct sbrec_chassis *chassis_rec,
bool sb_readonly, bool ovs_readonly)
{
if (!binding_data) {
@@ -405,7 +408,8 @@ if_status_mgr_update_bindings(struct if_status_mgr *mgr,
HMAPX_FOR_EACH (node, &mgr->ifaces_per_state[OIF_INSTALL_FLOWS]) {
struct ovs_iface *iface = node->data;
- local_binding_set_down(bindings, iface->id, sb_readonly, ovs_readonly);
+ local_binding_set_down(bindings, iface->id, chassis_rec,
+ sb_readonly, ovs_readonly);
}
/* Notifiy the binding module to set "up" all bindings that have had
@@ -416,7 +420,7 @@ if_status_mgr_update_bindings(struct if_status_mgr *mgr,
HMAPX_FOR_EACH (node, &mgr->ifaces_per_state[OIF_MARK_UP]) {
struct ovs_iface *iface = node->data;
- local_binding_set_up(bindings, iface->id, ts_now_str,
+ local_binding_set_up(bindings, iface->id, chassis_rec, ts_now_str,
sb_readonly, ovs_readonly);
}
free(ts_now_str);
@@ -427,7 +431,8 @@ if_status_mgr_update_bindings(struct if_status_mgr *mgr,
HMAPX_FOR_EACH (node, &mgr->ifaces_per_state[OIF_MARK_DOWN]) {
struct ovs_iface *iface = node->data;
- local_binding_set_down(bindings, iface->id, sb_readonly, ovs_readonly);
+ local_binding_set_down(bindings, iface->id, chassis_rec,
+ sb_readonly, ovs_readonly);
}
}
@@ -33,6 +33,7 @@ void if_status_mgr_delete_iface(struct if_status_mgr *, const char *iface_id);
void if_status_mgr_update(struct if_status_mgr *, struct local_binding_data *);
void if_status_mgr_run(struct if_status_mgr *mgr, struct local_binding_data *,
+ const struct sbrec_chassis *,
bool sb_readonly, bool ovs_readonly);
void if_status_mgr_get_memory_usage(struct if_status_mgr *mgr,
struct simap *usage);
@@ -4033,8 +4033,8 @@ main(int argc, char *argv[])
time_msec());
stopwatch_start(IF_STATUS_MGR_RUN_STOPWATCH_NAME,
time_msec());
- if_status_mgr_run(if_mgr, binding_data, !ovnsb_idl_txn,
- !ovs_idl_txn);
+ if_status_mgr_run(if_mgr, binding_data, chassis,
+ !ovnsb_idl_txn, !ovs_idl_txn);
stopwatch_stop(IF_STATUS_MGR_RUN_STOPWATCH_NAME,
time_msec());
}