aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-10-19 16:03:31 -0700
committerBen Pfaff <blp@nicira.com>2011-10-24 09:31:34 -0700
commit63adcc7d3fa1e136685f44edb03887222ea74bd8 (patch)
tree9515c0207c86396f1b6c6e6b909076385a0a7a47
parentc573540b89ddf0f4c74f0ebb6d237388d660e8fa (diff)
ofproto: Check for overlapping flows only in the target table.
There's no reason to check for overlapping flows in table A if the flow is going to be inserted into table B. (I doubt anyone actually uses OFPFF_CHECK_OVERLAP though.)
-rw-r--r--ofproto/ofproto.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 0d80e131..7543e114 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2356,17 +2356,6 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn,
struct rule *rule;
int error;
- /* Check for overlap, if requested. */
- if (fm->flags & OFPFF_CHECK_OVERLAP) {
- struct classifier *cls;
-
- FOR_EACH_MATCHING_TABLE (cls, fm->table_id, ofproto) {
- if (classifier_rule_overlaps(cls, &fm->cr)) {
- return ofp_mkerr(OFPET_FLOW_MOD_FAILED, OFPFMFC_OVERLAP);
- }
- }
- }
-
/* Pick table. */
if (fm->table_id == 0xff) {
uint8_t table_id;
@@ -2387,6 +2376,12 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn,
return ofp_mkerr_nicira(OFPET_FLOW_MOD_FAILED, NXFMFC_BAD_TABLE_ID);
}
+ /* Check for overlap, if requested. */
+ if (fm->flags & OFPFF_CHECK_OVERLAP
+ && classifier_rule_overlaps(table, &fm->cr)) {
+ return ofp_mkerr(OFPET_FLOW_MOD_FAILED, OFPFMFC_OVERLAP);
+ }
+
/* Serialize against pending deletion. */
if (is_flow_deletion_pending(ofproto, &fm->cr, table - ofproto->tables)) {
return OFPROTO_POSTPONE;