struct aa_mapping {
struct hmap_node hmap_node; /* In struct bridge's "mappings" hmap. */
struct bridge *bridge;
- int64_t isid;
- int64_t vlan;
+ uint32_t isid;
+ uint16_t vlan;
char *br_name;
};
static void bridge_configure_mcast_snooping(struct bridge *);
static void bridge_configure_sflow(struct bridge *, int *sflow_bridge_number);
static void bridge_configure_ipfix(struct bridge *);
-static void bridge_configure_stp(struct bridge *);
-static void bridge_configure_rstp(struct bridge *);
+static void bridge_configure_spanning_tree(struct bridge *);
static void bridge_configure_tables(struct bridge *);
static void bridge_configure_dp_desc(struct bridge *);
static void bridge_configure_aa(struct bridge *);
struct sockaddr_in in;
} sa;
- if (stream_parse_target_with_default_port(target, OVSDB_OLD_PORT,
+ if (stream_parse_target_with_default_port(target, OVSDB_PORT,
&sa.ss)
&& sa.ss.ss_family == AF_INET) {
managers[n_managers++] = sa.in;
bridge_configure_netflow(br);
bridge_configure_sflow(br, &sflow_bridge_number);
bridge_configure_ipfix(br);
- bridge_configure_stp(br);
- bridge_configure_rstp(br);
+ bridge_configure_spanning_tree(br);
bridge_configure_tables(br);
bridge_configure_dp_desc(br);
bridge_configure_aa(br);
/* Set spanning tree configuration on 'br'. */
static void
-bridge_configure_stp(struct bridge *br)
+bridge_configure_stp(struct bridge *br, bool enable_stp)
{
- struct ofproto_rstp_status rstp_status;
-
- ofproto_get_rstp_status(br->ofproto, &rstp_status);
- if (!br->cfg->stp_enable) {
- ofproto_set_stp(br->ofproto, NULL);
- } else if (rstp_status.enabled) {
- /* Do not activate STP if RSTP is enabled. */
- VLOG_ERR("STP cannot be enabled if RSTP is running.");
+ if (!enable_stp) {
ofproto_set_stp(br->ofproto, NULL);
- ovsrec_bridge_set_stp_enable(br->cfg, false);
} else {
struct ofproto_stp_settings br_s;
const char *config_str;
}
static void
-bridge_configure_rstp(struct bridge *br)
+bridge_configure_rstp(struct bridge *br, bool enable_rstp)
{
- struct ofproto_stp_status stp_status;
-
- ofproto_get_stp_status(br->ofproto, &stp_status);
- if (!br->cfg->rstp_enable) {
+ if (!enable_rstp) {
ofproto_set_rstp(br->ofproto, NULL);
- } else if (stp_status.enabled) {
- /* Do not activate RSTP if STP is enabled. */
- VLOG_ERR("RSTP cannot be enabled if STP is running.");
- ofproto_set_rstp(br->ofproto, NULL);
- ovsrec_bridge_set_rstp_enable(br->cfg, false);
} else {
struct ofproto_rstp_settings br_s;
const char *config_str;
}
}
+static void
+bridge_configure_spanning_tree(struct bridge *br)
+{
+ bool enable_rstp = br->cfg->rstp_enable;
+ bool enable_stp = br->cfg->stp_enable;
+
+ if (enable_rstp && enable_stp) {
+ VLOG_WARN("%s: RSTP and STP are mutually exclusive but both are "
+ "configured; enabling RSTP", br->name);
+ enable_stp = false;
+ }
+
+ bridge_configure_stp(br, enable_stp);
+ bridge_configure_rstp(br, enable_rstp);
+}
+
static bool
bridge_has_bond_fake_iface(const struct bridge *br, const char *name)
{
atom.integer = m->isid;
if (ovsdb_datum_find_key(mc, &atom, OVSDB_TYPE_UUID) == UINT_MAX) {
- VLOG_INFO("Deleting isid=%"PRId64", vlan=%"PRId64,
- m->isid,
- m->vlan);
+ VLOG_INFO("Deleting isid=%"PRIu32", vlan=%"PRIu16,
+ m->isid, m->vlan);
bridge_aa_mapping_destroy(m);
}
}
ofpbuf_init(&queues_buf, 0);
- if (!qos || qos->type[0] == '\0' || qos->n_queues < 1) {
+ if (!qos || qos->type[0] == '\0') {
netdev_set_qos(iface->netdev, NULL, NULL);
} else {
const struct ovsdb_datum *queues;
}
netdev_set_policing(iface->netdev,
- iface->cfg->ingress_policing_rate,
- iface->cfg->ingress_policing_burst);
+ MIN(UINT32_MAX, iface->cfg->ingress_policing_rate),
+ MIN(UINT32_MAX, iface->cfg->ingress_policing_burst));
ofpbuf_uninit(&queues_buf);
}