#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
+#include "async-append.h"
#include "bfd.h"
#include "bitmap.h"
#include "bond.h"
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_link_state);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_link_resets);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_mac_in_use);
+ ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_ifindex);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_mtu);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_ofport);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_statistics);
smap_get_int(&ovs_cfg->other_config, "flow-eviction-threshold",
OFPROTO_FLOW_EVICTION_THRESHOLD_DEFAULT));
+ ofproto_set_n_handler_threads(
+ smap_get_int(&ovs_cfg->other_config, "n-handler-threads", 0));
+
bridge_configure_flow_miss_model(smap_get(&ovs_cfg->other_config,
"force-miss-model"));
error = ofproto_port_del(br2->ofproto, ofproto_port.ofp_port);
if (error) {
VLOG_ERR("failed to delete port %s: %s", ofproto_port.name,
- strerror(error));
+ ovs_strerror(error));
}
ofproto_port_destroy(&ofproto_port);
}
error = ofproto_create(br->name, br->type, &br->ofproto);
if (error) {
VLOG_ERR("failed to create bridge %s: %s", br->name,
- strerror(error));
+ ovs_strerror(error));
bridge_destroy(br);
}
}
if (opt) {
if (strcmp(opt, "with-facets")) {
model = OFPROTO_HANDLE_MISS_WITH_FACETS;
- VLOG_INFO("Handling all flow misses by creating facets.\n");
- }
- if (strcmp(opt, "without-facets")) {
+ } else if (strcmp(opt, "without-facets")) {
model = OFPROTO_HANDLE_MISS_WITHOUT_FACETS;
- VLOG_INFO("Handling all flow misses without creating facets.\n");
}
}
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_ERR_RL(&rl, "bridge %s: failed to set bridge "
"Ethernet address: %s",
- br->name, strerror(error));
+ br->name, ovs_strerror(error));
}
}
memcpy(br->ea, ea, ETH_ADDR_LEN);
if (be_cfg->obs_point_id) {
be_opts.obs_point_id = *be_cfg->obs_point_id;
}
+ if (be_cfg->cache_active_timeout) {
+ be_opts.cache_active_timeout = *be_cfg->cache_active_timeout;
+ }
+ if (be_cfg->cache_max_flows) {
+ be_opts.cache_max_flows = *be_cfg->cache_max_flows;
+ }
}
if (n_fe_opts > 0) {
sset_init(&opts->targets);
sset_add_array(&opts->targets, fe_cfg->ipfix->targets,
fe_cfg->ipfix->n_targets);
+ opts->cache_active_timeout = fe_cfg->ipfix->cache_active_timeout
+ ? *fe_cfg->ipfix->cache_active_timeout : 0;
+ opts->cache_max_flows = fe_cfg->ipfix->cache_max_flows
+ ? *fe_cfg->ipfix->cache_max_flows : 0;
opts++;
}
}
error = netdev_set_config(netdev, &iface_cfg->options);
if (error) {
VLOG_WARN("could not configure network device %s (%s)",
- iface_cfg->name, strerror(error));
+ iface_cfg->name, ovs_strerror(error));
}
return error;
}
iface_get_type(iface_cfg, br->cfg), &netdev);
if (error) {
VLOG_WARN("could not open network device %s (%s)",
- iface_cfg->name, strerror(error));
+ iface_cfg->name, ovs_strerror(error));
goto error;
}
netdev_close(netdev);
} else {
VLOG_WARN("could not open network device %s (%s)",
- port->name, strerror(error));
+ port->name, ovs_strerror(error));
}
} else {
/* Already exists, nothing to do. */
int mtu;
int64_t mtu_64;
uint8_t mac[ETH_ADDR_LEN];
+ int64_t ifindex64;
int error;
if (iface_is_synthetic(iface)) {
} else {
ovsrec_interface_set_mac_in_use(iface->cfg, NULL);
}
+
+ /* The netdev may return a negative number (such as -EOPNOTSUPP)
+ * if there is no valid ifindex number. */
+ ifindex64 = netdev_get_ifindex(iface->netdev);
+ if (ifindex64 < 0) {
+ ifindex64 = 0;
+ }
+ ovsrec_interface_set_ifindex(iface->cfg, &ifindex64, 1);
}
/* Writes 'iface''s CFM statistics to the database. 'iface' must not be
} else {
ovsrec_interface_set_cfm_health(cfg, NULL, 0);
}
+
+ free(status.rmps);
}
}
* process that forked us to exit successfully. */
daemonize_complete();
+ vlog_enable_async();
+
VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name, VERSION);
}
}
}
} else {
ds_put_format(ds, "\tFailed to get statistics for queue %u: %s",
- queue_id, strerror(error));
+ queue_id, ovs_strerror(error));
}
}
error = netdev_dump_queues(iface->netdev, qos_unixctl_show_cb, &data);
if (error) {
- ds_put_format(&ds, "failed to dump queues: %s", strerror(error));
+ ds_put_format(&ds, "failed to dump queues: %s",
+ ovs_strerror(error));
}
unixctl_command_reply(conn, ds_cstr(&ds));
} else {
int error = netdev_set_etheraddr(iface->netdev, ea);
if (error) {
VLOG_ERR("interface %s: setting MAC failed (%s)",
- iface->name, strerror(error));
+ iface->name, ovs_strerror(error));
}
}
}
ovsrec_interface_set_cfm_remote_mpids(if_cfg, NULL, 0);
ovsrec_interface_set_lacp_current(if_cfg, NULL, 0);
ovsrec_interface_set_statistics(if_cfg, NULL, NULL, 0);
+ ovsrec_interface_set_ifindex(if_cfg, NULL, 0);
}
}
if (!netdev_open(vlan_dev->name, "system", &netdev)) {
if (!netdev_get_in4(netdev, NULL, NULL) ||
!netdev_get_in6(netdev, NULL)) {
- vlandev_del(vlan_dev->name);
- } else {
/* It has an IP address configured, so we don't own
* it. Don't delete it. */
+ } else {
+ vlandev_del(vlan_dev->name);
}
netdev_close(netdev);
}