X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=vswitchd%2Fbridge.c;h=378a08cb5674173def36ad77f99dea14d7bb0632;hb=6161d3fd928edf7016abae60f549a135a2f83f09;hp=09696d5a188f86e171979b7728a6888bd7b3d5b0;hpb=06b592bcbe2e5a435589b0ce3d77530756c20572;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 09696d5a..378a08cb 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -240,6 +240,7 @@ bridge_init(const char *remote) ovsdb_idl_omit(idl, &ovsrec_bridge_col_external_ids); ovsdb_idl_omit_alert(idl, &ovsrec_port_col_status); + ovsdb_idl_omit_alert(idl, &ovsrec_port_col_statistics); ovsdb_idl_omit(idl, &ovsrec_port_col_external_ids); ovsdb_idl_omit(idl, &ovsrec_port_col_fake_bridge); @@ -545,6 +546,8 @@ port_configure(struct port *port) s.vlan_mode = PORT_VLAN_TRUNK; } } + s.use_priority_tags = !strcmp("true", get_port_other_config( + cfg, "priority-tags", "")); /* Get LACP settings. */ s.lacp = port_configure_lacp(port, &lacp_settings); @@ -1598,7 +1601,9 @@ port_refresh_stp_status(struct port *port) struct ofproto *ofproto = port->bridge->ofproto; struct iface *iface; struct ofproto_port_stp_status status; - char *keys[4], *values[4]; + char *keys[4]; + char *str_values[4]; + int64_t int_values[3]; size_t i; if (port_is_synthetic(port)) { @@ -1619,23 +1624,37 @@ port_refresh_stp_status(struct port *port) if (!status.enabled) { ovsrec_port_set_status(port->cfg, NULL, NULL, 0); + ovsrec_port_set_statistics(port->cfg, NULL, NULL, 0); return; } - keys[0] = "stp_port_id"; - values[0] = xasprintf(STP_PORT_ID_FMT, status.port_id); + /* Set Status column. */ + keys[0] = "stp_port_id"; + str_values[0] = xasprintf(STP_PORT_ID_FMT, status.port_id); keys[1] = "stp_state"; - values[1] = xstrdup(stp_state_name(status.state)); + str_values[1] = xstrdup(stp_state_name(status.state)); keys[2] = "stp_sec_in_state"; - values[2] = xasprintf("%u", status.sec_in_state); + str_values[2] = xasprintf("%u", status.sec_in_state); keys[3] = "stp_role"; - values[3] = xstrdup(stp_role_name(status.role)); + str_values[3] = xstrdup(stp_role_name(status.role)); - ovsrec_port_set_status(port->cfg, keys, values, ARRAY_SIZE(values)); + ovsrec_port_set_status(port->cfg, keys, str_values, + ARRAY_SIZE(str_values)); - for (i = 0; i < ARRAY_SIZE(values); i++) { - free(values[i]); + for (i = 0; i < ARRAY_SIZE(str_values); i++) { + free(str_values[i]); } + + /* Set Statistics column. */ + keys[0] = "stp_tx_count"; + int_values[0] = status.tx_count; + keys[1] = "stp_rx_count"; + int_values[1] = status.rx_count; + keys[2] = "stp_error_count"; + int_values[2] = status.error_count; + + ovsrec_port_set_statistics(port->cfg, keys, int_values, + ARRAY_SIZE(int_values)); } static bool @@ -3005,6 +3024,8 @@ iface_configure_cfm(struct iface *iface) s.mpid = *cfg->cfm_mpid; s.interval = atoi(get_interface_other_config(iface->cfg, "cfm_interval", "0")); + s.ccm_vlan = atoi(get_interface_other_config(iface->cfg, "cfm_ccm_vlan", + "0")); if (s.interval <= 0) { s.interval = 1000; }