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"));
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++;
}
}
} else {
ovsrec_interface_set_cfm_health(cfg, NULL, 0);
}
+
+ free(status.rmps);
}
}
* process that forked us to exit successfully. */
daemonize_complete();
- async_append_enable();
+ vlog_enable_async();
VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name, VERSION);
}
};
static void
-qos_unixctl_show_cb(unsigned int queue_id,
- const struct smap *details,
- void *aux)
+qos_unixctl_show_queue(unsigned int queue_id,
+ const struct smap *details,
+ struct iface *iface,
+ struct ds *ds)
{
- struct qos_unixctl_show_cbdata *data = aux;
- struct ds *ds = data->ds;
- struct iface *iface = data->iface;
struct netdev_queue_stats stats;
struct smap_node *node;
int error;
struct iface *iface;
const char *type;
struct smap_node *node;
- struct qos_unixctl_show_cbdata data;
- int error;
iface = iface_find(argv[1]);
if (!iface) {
netdev_get_qos(iface->netdev, &type, &smap);
if (*type != '\0') {
+ struct netdev_queue_dump dump;
+ struct smap details;
+ unsigned int queue_id;
+
ds_put_format(&ds, "QoS: %s %s\n", iface->name, type);
SMAP_FOR_EACH (node, &smap) {
ds_put_format(&ds, "%s: %s\n", node->key, node->value);
}
- data.ds = &ds;
- data.iface = iface;
- error = netdev_dump_queues(iface->netdev, qos_unixctl_show_cb, &data);
-
- if (error) {
- ds_put_format(&ds, "failed to dump queues: %s",
- ovs_strerror(error));
+ smap_init(&details);
+ NETDEV_QUEUE_FOR_EACH (&queue_id, &details, &dump, iface->netdev) {
+ qos_unixctl_show_queue(queue_id, &details, iface, &ds);
}
+ smap_destroy(&details);
+
unixctl_command_reply(conn, ds_cstr(&ds));
} else {
ds_put_format(&ds, "QoS not configured on %s\n", iface->name);
}
}
-struct iface_delete_queues_cbdata {
- struct netdev *netdev;
- const struct ovsdb_datum *queues;
-};
-
static bool
queue_ids_include(const struct ovsdb_datum *queues, int64_t target)
{
return ovsdb_datum_find_key(queues, &atom, OVSDB_TYPE_INTEGER) != UINT_MAX;
}
-static void
-iface_delete_queues(unsigned int queue_id,
- const struct smap *details OVS_UNUSED, void *cbdata_)
-{
- struct iface_delete_queues_cbdata *cbdata = cbdata_;
-
- if (!queue_ids_include(cbdata->queues, queue_id)) {
- netdev_delete_queue(cbdata->netdev, queue_id);
- }
-}
-
static void
iface_configure_qos(struct iface *iface, const struct ovsrec_qos *qos)
{
if (!qos || qos->type[0] == '\0' || qos->n_queues < 1) {
netdev_set_qos(iface->netdev, NULL, NULL);
} else {
- struct iface_delete_queues_cbdata cbdata;
+ const struct ovsdb_datum *queues;
+ struct netdev_queue_dump dump;
+ unsigned int queue_id;
+ struct smap details;
bool queue_zero;
size_t i;
netdev_set_qos(iface->netdev, qos->type, &qos->other_config);
/* Deconfigure queues that were deleted. */
- cbdata.netdev = iface->netdev;
- cbdata.queues = ovsrec_qos_get_queues(qos, OVSDB_TYPE_INTEGER,
- OVSDB_TYPE_UUID);
- netdev_dump_queues(iface->netdev, iface_delete_queues, &cbdata);
+ queues = ovsrec_qos_get_queues(qos, OVSDB_TYPE_INTEGER,
+ OVSDB_TYPE_UUID);
+ smap_init(&details);
+ NETDEV_QUEUE_FOR_EACH (&queue_id, &details, &dump, iface->netdev) {
+ if (!queue_ids_include(queues, queue_id)) {
+ netdev_delete_queue(iface->netdev, queue_id);
+ }
+ }
+ smap_destroy(&details);
/* Configure queues for 'iface'. */
queue_zero = false;
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);
}