#include "vlandev.h"
#include "lib/vswitch-idl.h"
#include "xenserver.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
#include "sflow_api.h"
#include "vlan-bitmap.h"
#include "packets.h"
*
* They are immutable: they never change between iface_create() and
* iface_destroy(). */
- struct list port_elem; /* Element in struct port's "ifaces" list. */
+ struct ovs_list port_elem; /* Element in struct port's "ifaces" list. */
struct hmap_node name_node; /* In struct bridge's "iface_by_name" hmap. */
struct hmap_node ofp_port_node; /* In struct bridge's "ifaces" hmap. */
struct port *port; /* Containing port. */
/* An ordinary bridge port has 1 interface.
* A bridge port for bonding has at least 2 interfaces. */
- struct list ifaces; /* List of "struct iface"s. */
+ struct ovs_list ifaces; /* List of "struct iface"s. */
};
struct bridge {
ovsdb_idl_omit(idl, &ovsrec_open_vswitch_col_system_version);
ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_datapath_id);
+ ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_datapath_version);
ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_status);
ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_rstp_status);
ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_stp_enable);
ovs_strerror(error));
shash_destroy(&br->wanted_ports);
bridge_destroy(br);
+ } else {
+ /* Trigger storing datapath version. */
+ seq_change(connectivity_seq_get());
}
}
}
port_s->priority = RSTP_DEFAULT_PORT_PRIORITY;
}
+ config_str = smap_get(&port->cfg->other_config, "rstp-admin-p2p-mac");
+ if (config_str) {
+ port_s->admin_p2p_mac_state = strtoul(config_str, NULL, 0);
+ } else {
+ port_s->admin_p2p_mac_state = RSTP_ADMIN_P2P_MAC_FORCE_TRUE;
+ }
+
+ port_s->admin_port_state = smap_get_bool(&port->cfg->other_config,
+ "rstp-admin-port-state", true);
+
port_s->admin_edge_port = smap_get_bool(&port->cfg->other_config,
"rstp-port-admin-edge", false);
port_s->auto_edge = smap_get_bool(&port->cfg->other_config,
#undef IFACE_STATS
}
+static void
+br_refresh_datapath_info(struct bridge *br)
+{
+ const char *version;
+
+ version = (br->ofproto && br->ofproto->ofproto_class->get_datapath_version
+ ? br->ofproto->ofproto_class->get_datapath_version(br->ofproto)
+ : NULL);
+
+ ovsrec_bridge_set_datapath_version(br->cfg,
+ version ? version : "<unknown>");
+}
+
static void
br_refresh_stp_status(struct bridge *br)
{
}
smap_add_format(&smap, "rstp_bridge_id", RSTP_ID_FMT,
RSTP_ID_ARGS(status.bridge_id));
- smap_add_format(&smap, "rstp_root_path_cost", "%d",
+ smap_add_format(&smap, "rstp_root_path_cost", "%"PRIu32,
status.root_path_cost);
smap_add_format(&smap, "rstp_root_id", RSTP_ID_FMT,
RSTP_ID_ARGS(status.root_id));
rstp_port_role_name(status.role));
smap_add_format(&smap, "rstp_port_state", "%s",
rstp_state_name(status.state));
+ smap_add_format(&smap, "rstp_designated_bridge_id", RSTP_ID_FMT,
+ RSTP_ID_ARGS(status.designated_bridge_id));
+ smap_add_format(&smap, "rstp_designated_port_id", RSTP_PORT_ID_FMT,
+ status.designated_port_id);
+ smap_add_format(&smap, "rstp_designated_path_cost", "%"PRIu32,
+ status.designated_path_cost);
ovsrec_port_set_rstp_status(port->cfg, &smap);
smap_destroy(&smap);
static void
port_refresh_bond_status(struct port *port, bool force_update)
{
- uint8_t mac[6];
+ uint8_t mac[ETH_ADDR_LEN];
/* Return if port is not a bond */
if (list_is_singleton(&port->ifaces)) {
br_refresh_stp_status(br);
br_refresh_rstp_status(br);
+ br_refresh_datapath_info(br);
HMAP_FOR_EACH (port, hmap_node, &br->ports) {
struct iface *iface;
static void
status_update_wait(void)
{
+ /* This prevents the process from constantly waking up on
+ * connectivity seq, when there is no connection to ovsdb. */
+ if (!ovsdb_idl_has_lock(idl)) {
+ return;
+ }
+
/* If the 'status_txn' is non-null (transaction incomplete), waits for the
* transaction to complete. If the status update to database needs to be
* run again (transaction fails), registers a timeout in
* with the current situation of multiple ovs-vswitchd daemons,
* disable system stats collection. */
system_stats_enable(false);
- /* This prevents the process from constantly waking up on
- * connectivity seq. */
- connectivity_seqno = seq_read(connectivity_seq_get());
return;
} else if (!ovsdb_idl_has_lock(idl)) {
return;