Skip to content

Commit

Permalink
ofp-util: Abstract table miss configuration and fix related bugs.
Browse files Browse the repository at this point in the history
The ofproto implementation has had an abstraction layer on top of
OFPTC11_TABLE_MISS for a while.  This commit pushes that abstraction layer
farther down, into ofp-util.  This will be more useful in an upcoming
commit.

During the conversion I realized that the previous implementation was
not entirely correct.  In particular, the OpenFlow 1.3+ "table mod" was
still being treated as if it had table miss configuration bits, even
though it doesn't.  This commit fixes that issue and updates the tests.

OpenFlow 1.4 adds some more OFPTC_* flags that this new abstraction doesn't
yet support, but OVS didn't support those flags any better before this
commit, so abstracting those is left as future work.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
blp committed Aug 11, 2014
1 parent b187a28 commit 3c1bb39
Show file tree
Hide file tree
Showing 12 changed files with 1,014 additions and 701 deletions.
9 changes: 5 additions & 4 deletions lib/ofp-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,16 +1865,17 @@ parse_ofp_table_mod(struct ofputil_table_mod *tm, const char *table_id,
}

if (strcmp(flow_miss_handling, "controller") == 0) {
tm->config = OFPTC11_TABLE_MISS_CONTROLLER;
tm->miss_config = OFPUTIL_TABLE_MISS_CONTROLLER;
} else if (strcmp(flow_miss_handling, "continue") == 0) {
tm->config = OFPTC11_TABLE_MISS_CONTINUE;
tm->miss_config = OFPUTIL_TABLE_MISS_CONTINUE;
} else if (strcmp(flow_miss_handling, "drop") == 0) {
tm->config = OFPTC11_TABLE_MISS_DROP;
tm->miss_config = OFPUTIL_TABLE_MISS_DROP;
} else {
return xasprintf("invalid flow_miss_handling %s", flow_miss_handling);
}

if (tm->table_id == 0xfe && tm->config == OFPTC11_TABLE_MISS_CONTINUE) {
if (tm->table_id == 0xfe
&& tm->miss_config == OFPUTIL_TABLE_MISS_CONTINUE) {
return xstrdup("last table's flow miss handling can not be continue");
}

Expand Down
Loading

0 comments on commit 3c1bb39

Please sign in to comment.