[ovs-git] [openvswitch/ovs] 8f8023: classifier: Make traversing identical rules robust...

GitHub noreply at github.com
Thu Jun 11 22:53:52 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 8f8023b3eee4f1b633f16fa9ea31a14eac2445f8
      https://github.com/openvswitch/ovs/commit/8f8023b3eee4f1b633f16fa9ea31a14eac2445f8
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M lib/classifier-private.h
    M lib/classifier.c
    M tests/test-classifier.c

  Log Message:
  -----------
  classifier: Make traversing identical rules robust.

The traversal of the list of identical rules from the lookup threads
is fragile if the list head is removed during the list traversal.

This patch simplifies the implementation of that list by making the
list NULL terminated, singly linked RCU-protected list.  By having the
NULL at the end there is no longer a possiblity of missing the point
when the list wraps around.  This is significant when there can be
multiple elements with the same priority in the list.

This change also decreases the size of the struct cls_match back
pre-'visibility' attribute size.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 3bbe9a1fdade79e94c0f4880cc5c17eee64df79e
      https://github.com/openvswitch/ovs/commit/3bbe9a1fdade79e94c0f4880cc5c17eee64df79e
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M tests/classifier.at
    M tests/test-classifier.c

  Log Message:
  -----------
  test-classifier: Test versioning features.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 621b8064b7f8921576dcba1c4b292ba1f6644061
      https://github.com/openvswitch/ovs/commit/621b8064b7f8921576dcba1c4b292ba1f6644061
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-dpif.h
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Infra for table versioning.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 39c9459355b6f010aa73ca80ad8d0e6893ef0a88
      https://github.com/openvswitch/ovs/commit/39c9459355b6f010aa73ca80ad8d0e6893ef0a88
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M NEWS
    M lib/classifier.c
    M lib/classifier.h
    M lib/ofp-actions.c
    M ofproto/bundles.h
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c
    M tests/ofproto.at
    M tests/ovs-ofctl.at
    M utilities/ovs-ofctl.8.in
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  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 at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: d79e3d701072f0c6b2f7b28e39b291eb12390997
      https://github.com/openvswitch/ovs/commit/d79e3d701072f0c6b2f7b28e39b291eb12390997
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M ofproto/connmgr.c
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Accurate flow counts.

Classifier's rule count now contains temporary duplicates and rules
whose deletion has been deferred.  Maintain a new 'n_flows' count in
struct oftable to as the count of rules in the latest version.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 6787a49f69168e78f5d8af8aa8be128385650a50
      https://github.com/openvswitch/ovs/commit/6787a49f69168e78f5d8af8aa8be128385650a50
  Author: Jarno Rajahalme <jrajahalme at nicira.com>
  Date:   2015-06-11 (Thu, 11 Jun 2015)

  Changed paths:
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Revertible eviction.

Handling evictions was broken in the previous patches. Eviction took
place early in the commit, and actually inappropriately bumped the
version number too early.  Now eviction is treated much like a flow
modification, where a new rule replaces the old one, but just without
any 'inheritance' from the evicted rule to the new rule.  This makes
evictions to be executed only when commit is successful, as evictions
are reverted like any other changes when the commit fails.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/48954dab23ee...6787a49f6916


More information about the git mailing list