]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif: Add idle_timeout parameter to ofproto_dpif_add_internal_flow()
authorSimon Horman <horms@verge.net.au>
Wed, 11 Jun 2014 00:28:05 +0000 (09:28 +0900)
committerBen Pfaff <blp@nicira.com>
Thu, 12 Jun 2014 00:11:49 +0000 (17:11 -0700)
This is in preparation for using the same helper as part of support
for using recirculation in conjunction series of actions including
with MPLS actions that are currently not able to be translated.

In that scenario the idle timeout will be used to expire internal
rules that are added to handle recirculation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/bond.c
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h

index 962d4d6ee2f2fbc9a91c2f45a22b216891b8f055..d2b0e732b128c2f5031da5e1017e8325bc05c462 100644 (file)
@@ -351,7 +351,7 @@ update_recirc_rules(struct bond *bond)
             ofpact_put_OUTPUT(&ofpacts)->port = pr_op->out_ofport;
             error = ofproto_dpif_add_internal_flow(bond->ofproto,
                                                    &pr_op->match,
-                                                   RECIRC_RULE_PRIORITY,
+                                                   RECIRC_RULE_PRIORITY, 0,
                                                    &ofpacts, pr_op->pr_rule);
             if (error) {
                 char *err_s = match_to_string(&pr_op->match,
index 513a5066e4022372c0b13f48fe7366dd33e4e97f..9bb004c4d9379dd8ba7a9e622606dcf11e0258e8 100644 (file)
@@ -1194,7 +1194,8 @@ add_internal_miss_flow(struct ofproto_dpif *ofproto, int id,
     match_init_catchall(&match);
     match_set_reg(&match, 0, id);
 
-    error = ofproto_dpif_add_internal_flow(ofproto, &match, 0, ofpacts, &rule);
+    error = ofproto_dpif_add_internal_flow(ofproto, &match, 0, 0, ofpacts,
+                                           &rule);
     *rulep = error ? NULL : rule_dpif_cast(rule);
 
     return error;
@@ -1252,7 +1253,7 @@ add_internal_flows(struct ofproto_dpif *ofproto)
     match_init_catchall(&match);
     match_set_recirc_id(&match, 0);
 
-    error = ofproto_dpif_add_internal_flow(ofproto, &match, 2, &ofpacts,
+    error = ofproto_dpif_add_internal_flow(ofproto, &match, 2, 0, &ofpacts,
                                            &unused_rulep);
     if (error) {
         return error;
@@ -1265,7 +1266,7 @@ add_internal_flows(struct ofproto_dpif *ofproto)
      */
     ofpbuf_clear(&ofpacts);
     match_init_catchall(&match);
-    error = ofproto_dpif_add_internal_flow(ofproto, &match, 1, &ofpacts,
+    error = ofproto_dpif_add_internal_flow(ofproto, &match, 1, 0, &ofpacts,
                                            &unused_rulep);
 
     return error;
@@ -4832,6 +4833,7 @@ ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id)
 int
 ofproto_dpif_add_internal_flow(struct ofproto_dpif *ofproto,
                                const struct match *match, int priority,
+                               uint16_t idle_timeout,
                                const struct ofpbuf *ofpacts,
                                struct rule **rulep)
 {
@@ -4847,7 +4849,7 @@ ofproto_dpif_add_internal_flow(struct ofproto_dpif *ofproto,
     fm.modify_cookie = false;
     fm.table_id = TBL_INTERNAL;
     fm.command = OFPFC_ADD;
-    fm.idle_timeout = 0;
+    fm.idle_timeout = idle_timeout;
     fm.hard_timeout = 0;
     fm.buffer_id = 0;
     fm.out_port = 0;
index 6905cb89472a5abd3d0dab8a5903c2db4b24e317..2038d756a76972115c4f4642bba27c0cd177a202 100644 (file)
@@ -223,6 +223,7 @@ uint32_t ofproto_dpif_alloc_recirc_id(struct ofproto_dpif *ofproto);
 void ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id);
 int ofproto_dpif_add_internal_flow(struct ofproto_dpif *,
                                    const struct match *, int priority,
+                                   uint16_t idle_timeout,
                                    const struct ofpbuf *ofpacts,
                                    struct rule **rulep);
 int ofproto_dpif_delete_internal_flow(struct ofproto_dpif *, struct match *,