[ovs-git] Open vSwitch: datapath: Drop constness of datapath pointers. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Dec 30 17:37:18 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  027f90073af54d394f629f4f091a316b26beec67 (commit)
       via  1cf7d1b80f1e88ffc533f32081a2ea3c48b1213e (commit)
       via  633d3ac7dc4ac473a4e2a4f7bff32f3023b45cf6 (commit)
       via  f072ebdd57ee86cdc86aac59b5d993cffc37e2e5 (commit)
       via  609af740ae40b37f2c0041dd8d6ed1e6be311fee (commit)
       via  b0fb95ac4b36de9b03405dfb0883e69cee8d2fb3 (commit)
       via  8f843b6f0fc45fdba373024aaa759785938858fc (commit)
      from  33b5304b913bb8018ea39f5ee5e00e60e65fe0da (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 027f90073af54d394f629f4f091a316b26beec67
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=027f90073af54d394f629f4f091a316b26beec67
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Drop constness of datapath pointers.
		
A few places marked struct datapath pointers as const since they
didn't expect to make modifications.  However, when compiled with
lockdep the datapath mutex pointer is passed to lockdep_is_held(),
which has a non-const argument.  That provoked warnings about
casting away the const, so this drops the const from the original
pointers.

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


commit 1cf7d1b80f1e88ffc533f32081a2ea3c48b1213e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=1cf7d1b80f1e88ffc533f32081a2ea3c48b1213e
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Report ifindex of 0 if vport doesn't have one.
		
If a vport is a virtual device then it doesn't have a system ifindex.
We currently return the ifindex of the bridge device in this situation
but that's somewhat misleading, so this replaces it with 0.  Nothing
actually reads the ifindex for devices other than the bridge device,
so this doesn't have a functional change.

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


commit 633d3ac7dc4ac473a4e2a4f7bff32f3023b45cf6
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=633d3ac7dc4ac473a4e2a4f7bff32f3023b45cf6
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Don't check for RCU in free_buckets in table.
		
free_buckets() is only called in places where the lifetime of its
container has ended: on allocation failure and on deletion after
a grace period.  If the container can no longer be referenced then
neither can the buckets, so it is safe to directly free them.
sparse complains if the pointer is directly dereferenced and lockdep
complains if the RCU functions are used without some type of lock,
both of which are fine in this case.  This adds an explicit cast to
avoid the complaints.

Found with lockdep.

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


commit f072ebdd57ee86cdc86aac59b5d993cffc37e2e5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=f072ebdd57ee86cdc86aac59b5d993cffc37e2e5
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Hold dp->mutex when calling new_vport().
		
On datapath creation we hold dp_mutex but not dp->mutex when
creating the vport for the datapath device.  However, there are
lockdep checks that validate that we hold dp->mutex during the call
to new_vport().  The lock isn't actually necessary in this case
because no one else can access the datapath but it's good to have
the lock assertions, so this holds dp->mutex while initializing
the datapath.

Found with lockdep.

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


commit 609af740ae40b37f2c0041dd8d6ed1e6be311fee
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=609af740ae40b37f2c0041dd8d6ed1e6be311fee
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Add owner to file_operations declaration.
		
It's currently possible for operations on our character device to
be still running when we unload the module.  This will result in
an oops when the executing code is suddenly freed.  The chrdev
code has a way to avoid this by taking a reference on the module
every time the device is opened, which means that we can't be
unloaded as long as there is an open file descriptor and therefore
the possibility of an operation.  However, our file_operations
structure doesn't include an owner member, which prevents this
mechanism from working.  This adds one.

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


commit b0fb95ac4b36de9b03405dfb0883e69cee8d2fb3
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b0fb95ac4b36de9b03405dfb0883e69cee8d2fb3
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Acquire dp->mutex when deleting a datapath.
		
It's possible that someone is using the datapath data structures
when we attempt to delete the datapath.  The first writer will
only hold dp->mutex, which we don't currently acquire when deleting.
This adds that lock to prevent a potential race (this can't currently
happen because userspace is single threaded, as long as "ovs-dpctl
del-dp" is not used at the same time).

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


commit 8f843b6f0fc45fdba373024aaa759785938858fc
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8f843b6f0fc45fdba373024aaa759785938858fc
Author: Jesse Gross <jesse at nicira.com>
		
datapath: Merge do_destroy_dp into destroy_dp.
		
Both do_destroy_dp() and destroy_dp() are small functions and
only have a single caller.  There's no good reason for them to
be separate so this merges them together.  It also makes things
more logically consistent and easier to read in the next commit,
which adds additional locking as everything is in one place.

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


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

Summary of changes:
 datapath/datapath.c |   47 ++++++++++++++++++++++++-----------------------
 datapath/table.c    |    2 +-
 datapath/vport.c    |   15 ++++++---------
 3 files changed, 31 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list