bool revalidating);
static void rule_install(struct ofproto *, struct rule *,
struct odp_flow_stats *);
-static void rule_uninstall(struct ofproto *, struct rule *,
- struct odp_flow_stats *);
+static void rule_uninstall(struct ofproto *, struct rule *);
struct ofconn {
struct list node;
static void send_packet_in_miss(struct ofpbuf *, void *ofproto);
static void send_packet_in_action(struct ofpbuf *, void *ofproto);
static void update_used(struct ofproto *);
+static void update_stats(struct rule *, const struct odp_flow_stats *);
static void expire_rule(struct cls_rule *, void *ofproto);
static bool revalidate_rule(struct ofproto *p, struct rule *rule);
static void revalidate_cb(struct cls_rule *rule_, void *p_);
}
static void
-rule_uninstall(struct ofproto *p, struct rule *rule,
- struct odp_flow_stats *stats)
+rule_uninstall(struct ofproto *p, struct rule *rule)
{
assert(!rule->cr.wc.wildcards);
- if (stats) {
- memset(stats, 0, sizeof *stats);
- }
if (rule->installed) {
struct odp_flow odp_flow;
odp_flow.key = rule->cr.flow;
odp_flow.actions = NULL;
odp_flow.n_actions = 0;
- if (!dpif_flow_del(&p->dpif, &odp_flow) && stats) {
- *stats = odp_flow.stats;
+ if (!dpif_flow_del(&p->dpif, &odp_flow)) {
+ update_stats(rule->super && rule->super != UNKNOWN_SUPER
+ ? rule->super : rule, &odp_flow.stats);
}
rule->installed = false;
}
}
if (command == OFPFC_DELETE) {
if (!rule->cr.wc.wildcards) {
- rule_uninstall(p, rule, NULL);
+ rule_uninstall(p, rule);
}
classifier_remove(&p->cls, &rule->cr);
rule_destroy(rule);
struct rule *super;
super = rule_from_cls_rule(classifier_lookup_wild(&p->cls, flow));
if (!super) {
- rule_uninstall(p, rule, NULL);
+ rule_uninstall(p, rule);
classifier_remove(&p->cls, &rule->cr);
rule_destroy(rule);
return false;
struct rule *subrule, *next_subrule;
LIST_FOR_EACH_SAFE (subrule, next_subrule,
struct rule, list, &rule->list) {
- struct odp_flow_stats stats;
- rule_uninstall(p, subrule, &stats);
- update_stats(rule, &stats);
+ rule_uninstall(p, subrule);
classifier_remove(&p->cls, &subrule->cr);
rule_destroy(subrule);
}
} else {
- rule_uninstall(p, rule, NULL);
+ rule_uninstall(p, rule);
}
}