When we receive an OpenFlow management protocol Config Update, we
immediately force the switch to reconfigure itself. This is
functionally correct, but it can cause long delays before return control
back to the switch. We now keep track of whether there were any changes
and then only force a reconfigure once per management run.
static struct svec mgmt_cfg;
static uint8_t cfg_cookie[CFG_COOKIE_LEN];
static struct svec mgmt_cfg;
static uint8_t cfg_cookie[CFG_COOKIE_LEN];
+static bool need_reconfigure = false;
static struct rconn *mgmt_rconn;
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 60);
static struct svec capabilities;
static struct rconn *mgmt_rconn;
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 60);
static struct svec capabilities;
* connection settings may have changed. */
send_config_update_ack(xid, true);
* connection settings may have changed. */
send_config_update_ack(xid, true);
+ need_reconfigure = true;
return handler(xid, msg);
}
return handler(xid, msg);
}
mgmt_run(void)
{
int i;
if (!mgmt_rconn) {
mgmt_run(void)
{
int i;
if (!mgmt_rconn) {
+ need_reconfigure = false;
rconn_run(mgmt_rconn);
/* Do some processing, but cap it at a reasonable amount so that
rconn_run(mgmt_rconn);
/* Do some processing, but cap it at a reasonable amount so that
VLOG_WARN_RL(&rl, "received too-short OpenFlow message");
}
}
VLOG_WARN_RL(&rl, "received too-short OpenFlow message");
}
}
+
+ return need_reconfigure;
void mgmt_init(void);
void mgmt_reconfigure(void);
void mgmt_init(void);
void mgmt_reconfigure(void);
void mgmt_wait(void);
uint64_t mgmt_get_mgmt_id(void);
void mgmt_wait(void);
uint64_t mgmt_get_mgmt_id(void);
vlog_reopen_log_file();
reconfigure();
}
vlog_reopen_log_file();
reconfigure();
}
+ if (mgmt_run()) {
+ need_reconfigure = true;
+ }
if (bridge_run()) {
need_reconfigure = true;
}
if (bridge_run()) {
need_reconfigure = true;
}