On Sat, Nov 19, 2011 at 02:11:48PM -0800, Jesse Gross wrote:
> We currently have a wrapper to protect the datapath ports array.
> However, this can lead to confusion over exactly what lock is
> protecting the access (either RTNL or RCU).  This removes the
> wrapper in favor of directly accessing the data, which also has
> the benefit of being less permissive about what lock we allow so
> it can be restricted to the one that we expect.
> 
> Signed-off-by: Jesse Gross <je...@nicira.com>

> @@ -132,7 +126,7 @@ static int get_dpifindex(struct datapath *dp)
>  
>       rcu_read_lock();
>  
> -     local = get_vport_protected(dp, OVSP_LOCAL);
> +     local = rcu_dereference(dp->ports[OVSP_LOCAL]);
>       if (local)
>               ifindex = local->ops->get_ifindex(local);
>       else

get_dpifindex() is called from dp_fill_ifinfo(), which holds RTNL but
I don't see that it holds RCU.

Otherwise this looks good to me.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to