struct mbridge *mbridge; /* Mirroring. */
struct dpif_sflow *sflow; /* SFlow handle, or null. */
struct dpif_ipfix *ipfix; /* Ipfix handle, or null. */
+ struct netflow *netflow; /* Netflow handle, or null. */
struct stp *stp; /* STP or null if disabled. */
/* Special rules installed by ofproto-dpif. */
struct rule_dpif *no_packet_in_rule;
enum ofp_config_flags frag; /* Fragmentation handling. */
- bool has_netflow; /* Bridge runs netflow? */
bool has_in_band; /* Bridge has in band control? */
bool forward_bpdu; /* Bridge forwards STP BPDUs? */
};
const struct mac_learning *ml, struct stp *stp,
const struct mbridge *mbridge,
const struct dpif_sflow *sflow,
- const struct dpif_ipfix *ipfix, enum ofp_config_flags frag,
- bool forward_bpdu, bool has_in_band, bool has_netflow)
+ const struct dpif_ipfix *ipfix,
+ const struct netflow *netflow, enum ofp_config_flags frag,
+ bool forward_bpdu, bool has_in_band)
{
struct xbridge *xbridge = xbridge_lookup(ofproto);
xbridge->stp = stp_ref(stp);
}
+ if (xbridge->netflow != netflow) {
+ netflow_unref(xbridge->netflow);
+ xbridge->netflow = netflow_ref(netflow);
+ }
+
free(xbridge->name);
xbridge->name = xstrdup(name);
xbridge->dpif = dpif;
xbridge->forward_bpdu = forward_bpdu;
xbridge->has_in_band = has_in_band;
- xbridge->has_netflow = has_netflow;
xbridge->frag = frag;
xbridge->miss_rule = miss_rule;
xbridge->no_packet_in_rule = no_packet_in_rule;
group_dpif_get_buckets(group, &buckets);
LIST_FOR_EACH (bucket, list_node, buckets) {
if (bucket_is_alive(ctx, bucket, 0)) {
- uint32_t score = hash_int(i, basis);
+ uint32_t score = (hash_int(i, basis) & 0xffff) * bucket->weight;
if (score >= best_score) {
best_bucket = bucket;
best_score = score;
/* If 'struct flow' gets additional metadata, we'll need to zero it out
* before traversing a patch port. */
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 22);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 23);
if (!xport) {
xlate_report(ctx, "Nonexistent output port");
if (ctx->xin->resubmit_stats) {
netdev_vport_inc_tx(xport->netdev, ctx->xin->resubmit_stats);
netdev_vport_inc_rx(peer->netdev, ctx->xin->resubmit_stats);
+ if (peer->bfd) {
+ bfd_account_rx(peer->bfd, ctx->xin->resubmit_stats);
+ }
}
return;
/* XXX
* check if table configuration flags
- * OFPTC_TABLE_MISS_CONTROLLER, default.
- * OFPTC_TABLE_MISS_CONTINUE,
- * OFPTC_TABLE_MISS_DROP
- * When OF1.0, OFPTC_TABLE_MISS_CONTINUE is used. What to do? */
+ * OFPTC11_TABLE_MISS_CONTROLLER, default.
+ * OFPTC11_TABLE_MISS_CONTINUE,
+ * OFPTC11_TABLE_MISS_DROP
+ * When OF1.0, OFPTC11_TABLE_MISS_CONTINUE is used. What to do? */
xport = get_ofp_port(ctx->xbridge, ctx->xin->flow.in_port.ofp_port);
choose_miss_rule(xport ? xport->config : 0,
ctx->xbridge->miss_rule,
wc->masks.nw_frag |= FLOW_NW_FRAG_MASK;
tnl_may_send = tnl_xlate_init(&ctx.base_flow, flow, wc);
- if (ctx.xbridge->has_netflow) {
+ if (ctx.xbridge->netflow) {
netflow_mask_wc(flow, wc);
}
/* Clear the metadata and register wildcard masks, because we won't
* use non-header fields as part of the cache. */
- memset(&wc->masks.metadata, 0, sizeof wc->masks.metadata);
- memset(&wc->masks.regs, 0, sizeof wc->masks.regs);
+ flow_wildcards_clear_non_packet_fields(wc);
out:
rule_actions_unref(actions);