Skip to content

Commit

Permalink
ofproto: Check for overlapping flows only in the target table.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
blp committed Oct 24, 2011
1 parent c573540 commit 63adcc7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ofproto/ofproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 63adcc7

Please sign in to comment.