COVERAGE_DEFINE(rev_mac_learning);
COVERAGE_DEFINE(rev_inconsistency);
-struct avg_subfacet_rates {
- double add_rate; /* Moving average of new flows created per minute. */
- double del_rate; /* Moving average of flows deleted per minute. */
-};
-
/* All datapaths of a given type share a single dpif backer instance. */
struct dpif_backer {
char *type;
struct timer next_expiration;
struct ovs_rwlock odp_to_ofport_lock;
- struct hmap odp_to_ofport_map OVS_GUARDED; /* ODP port to ofport map. */
+ struct hmap odp_to_ofport_map OVS_GUARDED; /* Contains "struct ofport"s. */
struct simap tnl_backers; /* Set of dpif ports backing tunnels. */
* exposed via "ovs-appctl dpif/show". The goal is to learn about
* traffic patterns in ways that we can use later to improve Open vSwitch
* performance in new situations. */
- long long int created; /* Time when it is created. */
unsigned max_n_subfacet; /* Maximum number of flows */
unsigned avg_n_subfacet; /* Average number of flows. */
long long int avg_subfacet_life; /* Average life span of subfacets. */
backer->n_handler_threads = n_handler_threads;
backer->max_n_subfacet = 0;
- backer->created = time_msec();
backer->avg_n_subfacet = 0;
backer->avg_subfacet_life = 0;
s->state = stp_port_get_state(sp);
s->sec_in_state = (time_msec() - ofport->stp_state_entered) / 1000;
s->role = stp_port_get_role(sp);
+
+ return 0;
+}
+
+static int
+get_stp_port_stats(struct ofport *ofport_,
+ struct ofproto_port_stp_stats *s)
+{
+ struct ofport_dpif *ofport = ofport_dpif_cast(ofport_);
+ struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto);
+ struct stp_port *sp = ofport->stp_port;
+
+ if (!ofproto->stp || !sp) {
+ s->enabled = false;
+ return 0;
+ }
+
+ s->enabled = true;
stp_port_get_counts(sp, &s->tx_count, &s->rx_count, &s->error_count);
return 0;
xlate_in_init(&xin, ofproto, &facet->flow, new_rule, 0, NULL);
xlate_actions(&xin, &xout);
flow_wildcards_or(&xout.wc, &xout.wc, &wc);
+ /* Make sure non -packet fields are not masked. If not cleared,
+ * the memcmp() below may fail, causing an otherwise valid facet
+ * to be removed. */
+ flow_wildcards_clear_non_packet_fields(&xout.wc);
/* A facet's slow path reason should only change under dramatic
* circumstances. Rather than try to update everything, it's simpler to
in_port = get_ofp_port(ofproto, flow->in_port.ofp_port);
if (in_port && in_port->is_tunnel) {
netdev_vport_inc_rx(in_port->up.netdev, stats);
+ if (in_port->bfd) {
+ bfd_account_rx(in_port->bfd, stats);
+ }
}
xlate_in_init(&xin, ofproto, flow, NULL, stats->tcp_flags, NULL);
get_stp_status,
set_stp_port,
get_stp_port_status,
+ get_stp_port_stats,
set_queues,
bundle_set,
bundle_remove,