[ovs-git] Open vSwitch: datapath: Validate lock when handling flow actions. (master)

dev at openvswitch.org dev at openvswitch.org
Mon Dec 13 21:47:02 UTC 2010


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  d3c5445150eff927f4022008300436ca3dad3474 (commit)
       via  9abaf6b3f89952d0a34be58c8f72c60954db0daf (commit)
       via  eb3ccf114ad0780225d4e30315b7aa2dab9e200c (commit)
       via  758a12d2d92bfadbebcc65506780c8be68ecf3ac (commit)
       via  e33adfd0cea19a8a4dab5cdbe80e2fd636e48374 (commit)
       via  ad9197112ae58f338491e6344a9f66073e4bce95 (commit)
       via  8dda8c9b63c8803621f900beaa397c673b736197 (commit)
       via  e1040c772fbebc3abe9e7222f9c540112c4dca81 (commit)
       via  d3097efff7c612e25cbbcf4913c703a73b57e523 (commit)
       via  1b29ebe576bd4cf1354d1c2dac2a77f6e753c932 (commit)
       via  3d1c4cbe9964b749260dba64bf687d320dce64d3 (commit)
       via  fb3ea74b114e7c1089dfb8851d0b5fb18aa9a6ce (commit)
      from  961703de9684997c273ac34ab8d4e0fda1128759 (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 d3c5445150eff927f4022008300436ca3dad3474
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=d3c5445150eff927f4022008300436ca3dad3474
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Validate lock when handling flow actions.
		
When reading actions without rcu_read_lock we need to hold the
datapath lock.  This checks that using lockdep.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 9abaf6b3f89952d0a34be58c8f72c60954db0daf
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=9abaf6b3f89952d0a34be58c8f72c60954db0daf
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Check locks on access to flow table.
		
When accessing the flow table without holding rcu_read_lcok
we need to hold the lock on the datapath.  This enables lockdep
to validate that that is the case.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit eb3ccf114ad0780225d4e30315b7aa2dab9e200c
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=eb3ccf114ad0780225d4e30315b7aa2dab9e200c
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Validate access to DP array.
		
When access the array of DPs, we need to hold either rcu_read_lock
or dp_mutex.  This enables lockdep to validate those conditions.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 758a12d2d92bfadbebcc65506780c8be68ecf3ac
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=758a12d2d92bfadbebcc65506780c8be68ecf3ac
Author: Jesse Gross <jesse at nicira.com>
		
tunneling: Add checks for header cache lock.
		
When updating the tunnel header cache, we need to hold a lock to
protect against concurrent access.  This adds annotations to
make sparse happy when we access the data without rcu_read_lock
and enables lockdep to verify that we have the correct lock.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit e33adfd0cea19a8a4dab5cdbe80e2fd636e48374
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=e33adfd0cea19a8a4dab5cdbe80e2fd636e48374
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Convert rcu_dereference() to correct variant.
		
Using rcu_dereference() makes lockdep complain if rcu_read_lock
is not held.  This is OK if the update side lock is held.  This
adds checks to see if RTNL lock is held, if that is also a
correct form of protection.  Alternately, it enforces that RTNL
must be held.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit ad9197112ae58f338491e6344a9f66073e4bce95
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ad9197112ae58f338491e6344a9f66073e4bce95
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Don't directly access RCU protected pointers.
		
If RTNL lock is used to protected updates to RCU data structures
then it isn't necessary to use rcu_dereference() to access them if
RTNL is held.  This adds rtnl_dereference() to access these pointers
which has several benefits: documents the locking expectations;
checks that RTNL actually is held when run with lockdep; makes
sparse not complain about directly accessing RCU pointers.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 8dda8c9b63c8803621f900beaa397c673b736197
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8dda8c9b63c8803621f900beaa397c673b736197
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Correct byte order annotations.
		
We have generally been using the byte order specific data types
(i.e. __be32 instead of u32) in most places.  This corrects a
declaration and adds a few needed casts.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit e1040c772fbebc3abe9e7222f9c540112c4dca81
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=e1040c772fbebc3abe9e7222f9c540112c4dca81
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Add usage of __rcu annotation.
		
Sparse can warn about incorrect usage of RCU via direct access to
points when used in conjuction with __rcu and CONFIG_SPARSE_RCU.
This adds the necessary annotations.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit d3097efff7c612e25cbbcf4913c703a73b57e523
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=d3097efff7c612e25cbbcf4913c703a73b57e523
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Add usage of __percpu annotation.
		
Sparse can warn if percpu pointers are incorrectly directly
dereference.  This adds the annotation where we declare percpu
pointers.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 1b29ebe576bd4cf1354d1c2dac2a77f6e753c932
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=1b29ebe576bd4cf1354d1c2dac2a77f6e753c932
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Correct usage of __user annotation.
		
We generally have been using the __user annotation but there were
a few places where it was missing or needed a cast.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 3d1c4cbe9964b749260dba64bf687d320dce64d3
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=3d1c4cbe9964b749260dba64bf687d320dce64d3
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Compatibility code for RCU check functions.
		
The rcu_dereference_rtnl() and rtnl_dereference() functions will
be introduced in 2.6.37.  They provide nice documentation of
locking expectations as well as checking on recent kernels.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit fb3ea74b114e7c1089dfb8851d0b5fb18aa9a6ce
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=fb3ea74b114e7c1089dfb8851d0b5fb18aa9a6ce
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Add compatibility code for sparse annotations.
		
The __percpu and __rcu annotations for sparse are relatively
recent additions, so provide no-op definitions on older kernels.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 datapath/datapath.c                                |  117 ++++++++++++--------
 datapath/datapath.h                                |    8 +-
 datapath/dp_sysfs_dp.c                             |    6 +-
 datapath/dp_sysfs_if.c                             |    5 +-
 datapath/flow.c                                    |    2 +-
 datapath/flow.h                                    |    2 +-
 datapath/linux-2.6/Modules.mk                      |    1 +
 .../linux-2.6/compat-2.6/include/linux/compiler.h  |   14 +++
 .../linux-2.6/compat-2.6/include/linux/rtnetlink.h |   48 ++++++++
 datapath/table.c                                   |   10 +-
 datapath/table.h                                   |    2 +-
 datapath/tunnel.c                                  |   63 ++++++-----
 datapath/tunnel.h                                  |    4 +-
 datapath/vport-gre.c                               |    8 +-
 datapath/vport-netdev.c                            |    4 +-
 datapath/vport-patch.c                             |   14 +--
 datapath/vport.h                                   |    2 +-
 17 files changed, 206 insertions(+), 104 deletions(-)
 create mode 100644 datapath/linux-2.6/compat-2.6/include/linux/compiler.h


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list