#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
+#include "async-append.h"
#include "bfd.h"
#include "bitmap.h"
#include "bond.h"
static void bridge_add_del_ports(struct bridge *,
const unsigned long int *splinter_vlans);
static void bridge_refresh_ofp_port(struct bridge *);
+static void bridge_configure_flow_miss_model(const char *opt);
static void bridge_configure_datapath_id(struct bridge *);
static void bridge_configure_netflow(struct bridge *);
static void bridge_configure_forward_bpdu(struct bridge *);
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));
+ bridge_configure_flow_miss_model(smap_get(&ovs_cfg->other_config,
+ "force-miss-model"));
+
/* Destroy "struct bridge"s, "struct port"s, and "struct iface"s according
* to 'ovs_cfg' while update the "if_cfg_queue", with only very minimal
* configuration otherwise.
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);
}
}
free(s.lacp_slaves);
}
+static void
+bridge_configure_flow_miss_model(const char *opt)
+{
+ enum ofproto_flow_miss_model model = OFPROTO_HANDLE_MISS_AUTO;
+
+ if (opt) {
+ if (strcmp(opt, "with-facets")) {
+ model = OFPROTO_HANDLE_MISS_WITH_FACETS;
+ } else if (strcmp(opt, "without-facets")) {
+ model = OFPROTO_HANDLE_MISS_WITHOUT_FACETS;
+ }
+ }
+
+ ofproto_set_flow_miss_model(model);
+}
+
/* Pick local port hardware address and datapath ID for 'br'. */
static void
bridge_configure_datapath_id(struct bridge *br)
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);
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
* process that forked us to exit successfully. */
daemonize_complete();
+ async_append_enable();
+
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);
}
}