diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2016-08-15 14:57:12 -0700 |
---|---|---|
committer | Jarno Rajahalme <jarno@ovn.org> | 2016-08-15 14:57:12 -0700 |
commit | 5bacd5cdd6318306fb34dc42d1bd848eba19f551 (patch) | |
tree | 819c9782ead12e8c5282e0a9a24574dd4eee2465 /ofproto/bundles.h | |
parent | 70a3f6ce11a7e56cdcf621da576a1dfd98deabe4 (diff) | |
download | openvswitch-5bacd5cdd6318306fb34dc42d1bd848eba19f551.tar.gz |
ofproto: Reduce bundle memory use.
Instead of storing the (big) struct ofputil_flow_mod, create the new
rule and/or create the rule criteria for matching at bundle message
insert time. This change reduces the size of a bundle flow mod from
3.5kb to 272 bytes, not counting the created rule, which was anyway
created during bundle commit.
In successful bundles this shifts work out of the ofproto_mutex
critical section and should thus reduce the time the mutex is held
during bundle commit.
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/bundles.h')
-rw-r--r-- | ofproto/bundles.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/bundles.h b/ofproto/bundles.h index 20543033b..802de775c 100644 --- a/ofproto/bundles.h +++ b/ofproto/bundles.h @@ -36,7 +36,7 @@ struct ofp_bundle_entry { enum ofptype type; /* OFPTYPE_FLOW_MOD, OFPTYPE_PORT_MOD, or * OFPTYPE_GROUP_MOD. */ union { - struct ofproto_flow_mod ofm; /* ofm.fm.ofpacts must be malloced. */ + struct ofproto_flow_mod ofm; struct ofproto_port_mod opm; struct ofproto_group_mod ogm; }; @@ -90,7 +90,7 @@ ofp_bundle_entry_free(struct ofp_bundle_entry *entry) { if (entry) { if (entry->type == OFPTYPE_FLOW_MOD) { - free(entry->ofm.fm.ofpacts); + ofproto_flow_mod_uninit(&entry->ofm); } else if (entry->type == OFPTYPE_GROUP_MOD) { ofputil_uninit_group_mod(&entry->ogm.gm); } |