From c84451a66e5e1c03c2c057874f089047ab502735 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 27 Feb 2013 15:44:06 -0800 Subject: [PATCH] ofproto-dpif: Ignore subfacet install errors. 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 --- ofproto/ofproto-dpif.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index a572f1875..9405f1dcb 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,25 +3848,9 @@ 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(); - } - - free(op->garbage); + free(flow_miss_ops[i].garbage); } hmap_destroy(&todo); } -- 2.43.0