[ovs-git] Open vSwitch: lib/classifier: Lockless lookups. (master)
dev at openvswitch.org
dev at openvswitch.org
Fri Jul 11 12:04:11 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".
The branch, master has been updated
via afae68b16f01559df44e3fd62f1fc020faec5731 (commit)
via f358a2cb2e545bd3ec3390892477441797f9a351 (commit)
via e65413ab8dfb23afcdada8c98e70d9208e4f3d5d (commit)
via c30cfa6b8bbb60cb92a9db778c4df17d0358632e (commit)
via 0426e67c2791ef49894fcea4148918f7c89d59d5 (commit)
via 5f0476ce4e51b4405b73a86f938a29a22d50ca8d (commit)
via f2c214029e1ac0c9bc0f7c2013fe178a6b08dd7f (commit)
from 0791315e4dbf82e293a759086ee17c84b12b1d6e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit afae68b16f01559df44e3fd62f1fc020faec5731
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=afae68b16f01559df44e3fd62f1fc020faec5731
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: Lockless lookups.
Now that all the relevant classifier structures use RCU and internal
mutual exclusion for modifications, we can remove the fat-rwlock and
thus make the classifier lookups lockless.
As the readers are operating concurrently with the writers, a
concurrent reader may or may not see a new rule being added by a
writer, depending on how the concurrent events overlap with each
other. Overall, this is no different from the former locked behavior,
but there the visibility of the new rule only depended on the timing
of the locking functions.
A new rule is first added to the segment indices, so the readers may
find the rule in the indices before the rule is visible in the
subtables 'rules' map. This may result in us losing the opportunity
to quit lookups earlier, resulting in sub-optimal wildcarding. This
will be fixed by forthcoming revalidation always scheduled after flow
table changes.
Similar behavior may happen due to us removing the overlapping rule
(if any) from the indices only after the corresponding new rule has
been added.
The subtable's max priority is updated only after a rule is inserted
to the maps, so the concurrent readers may not see the rule, as the
updated priority ordered subtable list will only be visible after the
subtable's max priority is updated.
Similarly, the classifier's partitions are updated by the caller after
the rule is inserted to the maps, so the readers may keep skipping the
subtable until they see the updated partitions.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit f358a2cb2e545bd3ec3390892477441797f9a351
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=f358a2cb2e545bd3ec3390892477441797f9a351
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: RCUify prefix trie code.
cls_set_prefix_fields() now synchronizes explicitly with the readers,
waiting them to finish using the old configuration before changing to
the new configuration.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit e65413ab8dfb23afcdada8c98e70d9208e4f3d5d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=e65413ab8dfb23afcdada8c98e70d9208e4f3d5d
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: Use internal mutex.
Add an internal mutex to struct cls_classifier, and reorganize
classifier internal structures according to the user of each field,
marking the fields that need to be protected by the mutex. This makes
locking requirements easier to track, and may make lookup more memory
efficient.
After this patch there is some double locking, as callers are taking
the fat-rwlock, and we take the mutex internally. A following patch
will remove the classifier fat-rwlock, removing the (double) locking
overhead.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit c30cfa6b8bbb60cb92a9db778c4df17d0358632e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=c30cfa6b8bbb60cb92a9db778c4df17d0358632e
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: Stylistic change.
Rename 'nbits' as 'n_bits' to be more consistent with other count-like
fields.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit 0426e67c2791ef49894fcea4148918f7c89d59d5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0426e67c2791ef49894fcea4148918f7c89d59d5
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/ovs-rcu: Export ovsrcu_synchronize().
A following patch will add the first external user.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit 5f0476ce4e51b4405b73a86f938a29a22d50ca8d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=5f0476ce4e51b4405b73a86f938a29a22d50ca8d
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: Simplify iteration with C99 declaration.
Hide the cursor from the classifier iteration users and move locking to
the iterators. This will make following RCU changes simpler, as the call
sites of the iterators need not be changed at that point.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
commit f2c214029e1ac0c9bc0f7c2013fe178a6b08dd7f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=f2c214029e1ac0c9bc0f7c2013fe178a6b08dd7f
Author: Jarno Rajahalme <jrajahalme at nicira.com>
lib/classifier: Use cmap.
Use cmap instead of hmap & hindex in classifier.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
-----------------------------------------------------------------------
Summary of changes:
lib/classifier.c | 692 +++++++++++++++++++++++++++++---------------
lib/classifier.h | 118 +++++---
lib/dpif-netdev.c | 25 +-
lib/ovs-rcu.c | 3 +-
lib/ovs-rcu.h | 4 +
ofproto/ofproto-dpif.c | 9 +-
ofproto/ofproto-provider.h | 46 ++-
ofproto/ofproto.c | 81 +-----
ofproto/ofproto.h | 3 +
tests/test-classifier.c | 130 +++++----
utilities/ovs-ofctl.c | 23 +-
11 files changed, 656 insertions(+), 478 deletions(-)
hooks/post-receive
--
Open vSwitch
More information about the git
mailing list