I intend to insert this before "ofproto-dpif: Handle tunnel config changes in facet_revalidate()." Once this is reviewed, I'll push the whole series.
--- When we fail to install a subfacet, there's not much we can do other than note that it happened. However, doing this requires us to maintain a pointer to a subfacet which theoretically could be destroyed by facet_revalidate() later. This patch solves the problem by simply assuming dpif_flow_put() always succeeds. This should have no effect on behavior. Signed-off-by: Ethan Jackson <et...@nicira.com> --- ofproto/ofproto-dpif.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index ef4ce99..3d09b9c 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3288,7 +3288,6 @@ struct flow_miss { struct flow_miss_op { struct dpif_op dpif_op; - struct subfacet *subfacet; /* Subfacet */ void *garbage; /* Pointer to pass to free(), NULL if none. */ uint64_t stub[1024 / 8]; /* Temporary buffer. */ }; @@ -3378,7 +3377,6 @@ init_flow_miss_execute_op(struct flow_miss *miss, struct ofpbuf *packet, eth_pop_vlan(packet); } - op->subfacet = NULL; op->garbage = NULL; op->dpif_op.type = DPIF_OP_EXECUTE; op->dpif_op.u.execute.key = miss->key; @@ -3522,7 +3520,6 @@ handle_flow_miss_with_facet(struct flow_miss *miss, struct facet *facet, struct dpif_execute *execute = &op->dpif_op.u.execute; init_flow_miss_execute_op(miss, packet, op); - op->subfacet = subfacet; if (!subfacet->slow) { execute->actions = subfacet->actions; execute->actions_len = subfacet->actions_len; @@ -3544,7 +3541,8 @@ handle_flow_miss_with_facet(struct flow_miss *miss, struct facet *facet, struct flow_miss_op *op = &ops[(*n_ops)++]; struct dpif_flow_put *put = &op->dpif_op.u.flow_put; - op->subfacet = subfacet; + subfacet->path = want_path; + op->garbage = NULL; op->dpif_op.type = DPIF_OP_FLOW_PUT; put->flags = DPIF_FP_CREATE | DPIF_FP_MODIFY; @@ -3850,24 +3848,10 @@ handle_miss_upcalls(struct dpif_backer *backer, struct dpif_upcall *upcalls, } dpif_operate(backer->dpif, dpif_ops, n_ops); - /* Free memory and update facets. */ + /* Free memory. */ for (i = 0; i < n_ops; i++) { struct flow_miss_op *op = &flow_miss_ops[i]; - - switch (op->dpif_op.type) { - case DPIF_OP_EXECUTE: - break; - - case DPIF_OP_FLOW_PUT: - if (!op->dpif_op.error) { - op->subfacet->path = subfacet_want_path(op->subfacet->slow); - } - break; - - case DPIF_OP_FLOW_DEL: - NOT_REACHED(); - } - + ovs_assert(op->dpif_op.type != DPIF_OP_FLOW_DEL); free(op->garbage); } hmap_destroy(&todo); -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev