2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

Use classifier versioning.

Each rule is now added or deleted in a specific tables version.  Flow
tables are versioned with a monotonically increasing 64-bit integer,
where positive values are valid version numbers.

Rule modifications are implemented as an insertion of a new rule and a
deletion of the old rule, both taking place in the same tables
version.  Since concurrent lookups may use different versions, both
the old and new rule must be available for lookups at the same time.

The ofproto provider interface is changed to accomodate the above.  As
rule's actions need not be modified any more, we no longer need
'rule_premodify_actions', nor 'rule_modify_actions'.  'rule_insert'
now takes a pointer to the old rule and adds a flag that tells whether
the old stats should be forwarded to the new rule or not (this
replaces the 'reset_counters' flag of the now removed
'rule_modify_actions').

Versioning all flow table changes has the side effect of making
learned flows visible for future lookups only.  I.e., the upcall that
executes the learn action, will not see the newly learned action in
it's classifier lookups.  Only upcalls that start executing after the
new flow was added will match on it.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2015-06-11 15:53:43 -07:00
parent 621b8064b7
commit 39c9459355
12 changed files with 701 additions and 582 deletions

View File

@@ -3660,7 +3660,24 @@ format_RESUBMIT(const struct ofpact_resubmit *a, struct ds *s)
* address. This is not usually the intent in MAC learning; instead, we want
* the MAC learn entry to expire when no traffic has been sent *from* the
* learned address. Use a hard timeout for that.
*/
*
*
* Visibility of Changes
* ---------------------
*
* Prior to Open vSwitch 2.4, any changes made by a "learn" action in a given
* flow translation are visible to flow table lookups made later in the flow
* translation. This means that, in the example above, a MAC learned by the
* learn action in table 0 would be found in table 1 (if the packet being
* processed had the same source and destination MAC address).
*
* In Open vSwitch 2.4 and later, changes to a flow table (whether to add or
* modify a flow) by a "learn" action are visible only for later flow
* translations, not for later lookups within the same flow translation. In
* the MAC learning example, a MAC learned by the learn action in table 0 would
* not be found in table 1 if the flow translation would resubmit to table 1
* after the processing of the learn action, meaning that if this MAC had not
* been learned before then the packet would be flooded. */
struct nx_action_learn {
ovs_be16 type; /* OFPAT_VENDOR. */
ovs_be16 len; /* At least 24. */