summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-provider.h
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2017-03-10 15:44:40 -0800
committerBen Pfaff <blp@ovn.org>2017-03-16 13:42:26 -0700
commit4c71600d2256641b927e04b75e95751355e799f8 (patch)
tree0f8393fa951fa4076dfe195864cc67638e64730c /ofproto/ofproto-provider.h
parent2ce5f3114b4c2054b9071e5b139a0a33f50986c3 (diff)
downloadopenvswitch-4c71600d2256641b927e04b75e95751355e799f8.tar.gz
ofp-actions: Add limit to learn action.
This commit adds a new feature to the learn actions: the possibility to limit the number of learned flows. To be compatible with users of the old learn action, a new structure is introduced as well as a new OpenFlow raw action number. There's a small corner case when we have to delete the ukey. This happens when: * The learned rule has expired (or has been deleted). * The ukey that learned the rule is still in the datapath. * No packets hit the datapath flow recently. In this case we cannot relearn the rule (because there are no new packets), and the actions might depend on the learn execution, so the only option is to delete the ukey. I don't think this has big performance implications since it's done only for ukey with no traffic. We could also slowpath it, but that will cause an action upcall and the correct datapath actions will be installed later by a revalidator. If we delete the ukey, the next upcall will be a miss upcall and that will immediatedly install the correct datapath flow. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-provider.h')
-rw-r--r--ofproto/ofproto-provider.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index cf6ef72de..b7b12cdfd 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -1934,7 +1934,8 @@ enum ofperr ofproto_flow_mod_init_for_learn(struct ofproto *,
const struct ofputil_flow_mod *,
struct ofproto_flow_mod *)
OVS_EXCLUDED(ofproto_mutex);
-enum ofperr ofproto_flow_mod_learn(struct ofproto_flow_mod *, bool keep_ref)
+enum ofperr ofproto_flow_mod_learn(struct ofproto_flow_mod *, bool keep_ref,
+ unsigned limit, bool *below_limit)
OVS_EXCLUDED(ofproto_mutex);
enum ofperr ofproto_flow_mod_learn_refresh(struct ofproto_flow_mod *ofm);
enum ofperr ofproto_flow_mod_learn_start(struct ofproto_flow_mod *ofm)