static void add_del_bridges(const struct ovsrec_open_vswitch *);
static void bridge_run__(void);
static void bridge_create(const struct ovsrec_bridge *);
-static void bridge_destroy(struct bridge *);
+static void bridge_destroy(struct bridge *, bool del);
static struct bridge *bridge_lookup(const char *name);
static unixctl_cb_func bridge_unixctl_dump_flows;
static unixctl_cb_func bridge_unixctl_reconnect;
if_notifier_destroy(ifnotifier);
HMAP_FOR_EACH_SAFE (br, next_br, node, &all_bridges) {
- bridge_destroy(br);
+ bridge_destroy(br, false);
}
ovsdb_idl_destroy(idl);
}
OFPROTO_FLOW_LIMIT_DEFAULT));
ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle",
OFPROTO_MAX_IDLE_DEFAULT));
- ofproto_set_n_dpdk_rxqs(smap_get_int(&ovs_cfg->other_config,
- "n-dpdk-rxqs", 0));
ofproto_set_cpu_mask(smap_get(&ovs_cfg->other_config, "pmd-cpu-mask"));
ofproto_set_threads(
VLOG_ERR("failed to create bridge %s: %s", br->name,
ovs_strerror(error));
shash_destroy(&br->wanted_ports);
- bridge_destroy(br);
+ bridge_destroy(br, true);
} else {
/* Trigger storing datapath version. */
seq_change(connectivity_seq_get());
add_del_bridges(const struct ovsrec_open_vswitch *cfg)
{
struct bridge *br, *next;
+ struct shash_node *node;
struct shash new_br;
size_t i;
br->cfg = shash_find_data(&new_br, br->name);
if (!br->cfg || strcmp(br->type, ofproto_normalize_type(
br->cfg->datapath_type))) {
- bridge_destroy(br);
+ bridge_destroy(br, true);
}
}
/* Add new bridges. */
- for (i = 0; i < cfg->n_bridges; i++) {
- const struct ovsrec_bridge *br_cfg = cfg->bridges[i];
+ SHASH_FOR_EACH(node, &new_br) {
+ const struct ovsrec_bridge *br_cfg = node->data;
struct bridge *br = bridge_lookup(br_cfg->name);
if (!br) {
bridge_create(br_cfg);
(long int) getpid());
HMAP_FOR_EACH_SAFE (br, next_br, node, &all_bridges) {
- bridge_destroy(br);
+ bridge_destroy(br, false);
}
/* Since we will not be running system_stats_run() in this process
* with the current situation of multiple ovs-vswitchd daemons,
}
static void
-bridge_destroy(struct bridge *br)
+bridge_destroy(struct bridge *br, bool del)
{
if (br) {
struct mirror *mirror, *next_mirror;
}
hmap_remove(&all_bridges, &br->node);
- ofproto_destroy(br->ofproto);
+ ofproto_destroy(br->ofproto, del);
hmap_destroy(&br->ifaces);
hmap_destroy(&br->ports);
hmap_destroy(&br->iface_by_name);