Suggested-by: Ben Pfaff <b...@nicira.com> Signed-off-by: Ethan Jackson <et...@nicira.com> --- ofproto/ofproto-dpif.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index b547298..22544f1 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -515,7 +515,7 @@ static struct facet *facet_find(struct ofproto_dpif *, 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 *); @@ -4892,10 +4892,8 @@ facet_lookup_valid(struct ofproto_dpif *ofproto, const struct flow *flow, 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); } @@ -5067,8 +5065,10 @@ facet_check_consistency(struct facet *facet) * 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); @@ -5103,7 +5103,7 @@ facet_revalidate(struct facet *facet) || recv_ofproto != ofproto || memcmp(&recv_flow, &facet->flow, sizeof recv_flow)) { facet_remove(facet); - return; + return false; } } @@ -5183,6 +5183,8 @@ facet_revalidate(struct facet *facet) facet->used = new_rule->up.created; facet->prev_used = facet->used; } + + return true; } /* Updates 'facet''s used time. Caller is responsible for calling -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev