diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2016-09-14 16:51:27 -0700 |
---|---|---|
committer | Jarno Rajahalme <jarno@ovn.org> | 2016-09-14 16:51:27 -0700 |
commit | 2c7ee5248496896b3794df1d8635b70370097847 (patch) | |
tree | fadc512acfe3ac4984c1e4bdc6d15780052072b3 /ofproto/ofproto-dpif-xlate-cache.h | |
parent | a027899ee3e5a65c9253a24be8f8abdd9c47a023 (diff) | |
download | openvswitch-2c7ee5248496896b3794df1d8635b70370097847.tar.gz |
ofproto: Use ofproto_flow_mod for learn execution from xlate cache.
Use ofproto_flow_mod with a reference to an existing or new rule
instead of ofputil_flow_mod for learn action execution from xlate
cache
Typically we would find that when a learn xlate cache entry is
created, a preceding upcall has already created the learned flow. In
this case the xlate cache entry takes a reference to that flow and
keeps refreshing it without needing to perform any flow table lookups.
Otherwise the creation of the xlate cache entry creates the new rule,
which is then subsequently added to the classifier. In both cases
this is both faster and shrinks the memory cost of each learn cache
entry from ~3.5kb to about 0.3kb.
If the learned rule does not yet exist, it is created and attached to
the ofproto_flow_mod, from which it is then added. If the referred
rule happens to expire, or is modified in any way and is thus removed
from the classifier tables, we create a new rule using the old rule as
a template, so that we can avoid storing the ofputil_flow_mod in all
cases.
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-xlate-cache.h')
-rw-r--r-- | ofproto/ofproto-dpif-xlate-cache.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-xlate-cache.h b/ofproto/ofproto-dpif-xlate-cache.h index 65717781b..3643177f0 100644 --- a/ofproto/ofproto-dpif-xlate-cache.h +++ b/ofproto/ofproto-dpif-xlate-cache.h @@ -91,9 +91,7 @@ struct xc_entry { uint16_t vid; } bond; struct { - struct ofproto_dpif *ofproto; - struct ofputil_flow_mod *fm; - struct ofpbuf *ofpacts; + struct ofproto_flow_mod *ofm; } learn; struct { struct ofproto_dpif *ofproto; |