diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-07-28 15:25:48 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-08-09 09:17:02 -0700 |
| commit | 0697b5c3c9954057028f406757c4fd0208b929b9 (patch) | |
| tree | d24f9c663578ecb9bfad4464418c2348f2006bd1 /ofproto | |
| parent | b772ded808ccc1b3cce2c10377a35637b1beb28c (diff) | |
| download | openvswitch-0697b5c3c9954057028f406757c4fd0208b929b9.tar.gz | |
ofproto-dpif: Add multiple table support.
Tables other than 0 can be modified and dumped, but they are not yet useful
because actions and flow table lookups never use them.
Diffstat (limited to 'ofproto')
| -rw-r--r-- | ofproto/ofproto-dpif.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index e94cd8952..a865d21ca 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -468,7 +468,7 @@ construct(struct ofproto *ofproto_, int *n_tablesp) ofproto->has_bundle_action = false; - *n_tablesp = 1; + *n_tablesp = 255; return 0; } @@ -489,14 +489,18 @@ destruct(struct ofproto *ofproto_) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); struct rule_dpif *rule, *next_rule; - struct cls_cursor cursor; + struct classifier *table; int i; complete_operations(ofproto); - cls_cursor_init(&cursor, &ofproto->up.tables[0], NULL); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) { - ofproto_rule_destroy(&rule->up); + OFPROTO_FOR_EACH_TABLE (table, &ofproto->up) { + struct cls_cursor cursor; + + cls_cursor_init(&cursor, table, NULL); + CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) { + ofproto_rule_destroy(&rule->up); + } } for (i = 0; i < MAX_MIRRORS; i++) { @@ -1744,7 +1748,7 @@ static int expire(struct ofproto_dpif *ofproto) { struct rule_dpif *rule, *next_rule; - struct cls_cursor cursor; + struct classifier *table; int dp_max_idle; /* Update stats for each flow in the datapath. */ @@ -1755,9 +1759,13 @@ expire(struct ofproto_dpif *ofproto) expire_facets(ofproto, dp_max_idle); /* Expire OpenFlow flows whose idle_timeout or hard_timeout has passed. */ - cls_cursor_init(&cursor, &ofproto->up.tables[0], NULL); - CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) { - rule_expire(rule); + OFPROTO_FOR_EACH_TABLE (table, &ofproto->up) { + struct cls_cursor cursor; + + cls_cursor_init(&cursor, table, NULL); + CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) { + rule_expire(rule); + } } /* All outstanding data in existing flows has been accounted, so it's a |
