const struct flow *, uint32_t hash);
static struct facet *facet_lookup_valid(struct ofproto_dpif *,
const struct flow *, uint32_t hash);
-static void facet_revalidate(struct facet *);
+static bool facet_revalidate(struct facet *);
static bool facet_check_consistency(struct facet *);
static void facet_flush_stats(struct facet *);
if (facet
&& (ofproto->backer->need_revalidate
|| tag_set_intersects(&ofproto->backer->revalidate_set,
- facet->tags))) {
- facet_revalidate(facet);
-
- /* facet_revalidate() may have destroyed 'facet'. */
+ facet->tags))
+ && !facet_revalidate(facet)) {
facet = facet_find(ofproto, flow, hash);
}
* where it is and recompiles its actions anyway.
*
* - If any of 'facet''s subfacets correspond to a new flow according to
- * ofproto_receive(), 'facet' is removed. */
-static void
+ * ofproto_receive(), 'facet' is removed.
+ *
+ * Returns true if 'facet' is still valid. False if 'facet' was removed. */
+static bool
facet_revalidate(struct facet *facet)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(facet->rule->up.ofproto);
|| recv_ofproto != ofproto
|| memcmp(&recv_flow, &facet->flow, sizeof recv_flow)) {
facet_remove(facet);
- return;
+ return false;
}
}
facet->used = new_rule->up.created;
facet->prev_used = facet->used;
}
+
+ return true;
}
/* Updates 'facet''s used time. Caller is responsible for calling