aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-02-27 15:44:06 -0800
committerEthan Jackson <ethan@nicira.com>2013-02-27 17:14:51 -0800
commit35bd902c33417cdedf72997e77635178e7239c4e (patch)
tree027124d7f62c85b2205f1cec9708c4294ada7828 /ofproto
parent761bc602429b4fc505914bec7ed180a1545f8b37 (diff)
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 <ethan@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index aca77a6c..6e63f2ca 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3296,7 +3296,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. */
};
@@ -3386,7 +3385,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;
@@ -3530,7 +3528,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;
@@ -3552,7 +3549,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;
@@ -3858,25 +3856,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);
}