[ovs-dev] [PATCH 16/19] datapath: RCU dereference correct pointer in table.

Ben Pfaff blp at nicira.com
Thu Dec 9 18:16:46 UTC 2010


On Wed, Dec 08, 2010 at 10:14:14PM -0800, Jesse Gross wrote:
> Our hash table implementation consists of two levels of buckets
> and then arrays of pointers.  The bucket arrays are fixed by the
> size of the table, which is therefore protected by the RCU
> dereference of the table pointer.  The arrays change when items
> are inserted or deleted.  However, in tbl_insert/remove we need
> to look at the old values and we do an rcu_dereference() on the
> second level array instead of the bucket itself.  Other places
> that access the table for lookup do the pointer dereference in
> the correct order.
> 
> Found by sparse.
> 
> Signed-off-by: Jesse Gross <jesse at nicira.com>

Acked-by: Ben Pfaff <blp at nicira.com>




More information about the dev mailing list