Good point on comments. I now agree it is necessary and should stay
with the function.

Comments aside, I am not happy with the nested rcu_read_lock(). It
seems unnecessary.

I will come up with a v2.

On Mon, Jul 14, 2014 at 5:58 PM, Joe Stringer <joestrin...@nicira.com> wrote:
> On 15 July 2014 12:53, Jarno Rajahalme <jrajaha...@nicira.com> wrote:
>>
>>
>> How about this:
>>
>> /* The caller must hold either rcu_read_lock or ovs_mutex to keep the
>> returned dp pointer valid. */
>
>
> This looks good. And I think it's better to have it at get_dp() rather than
> the callers, to help prevent future misuse of the function. Callers who do
> not do this may inadvertently reintroduce a race condition of the type fixed
> in commit 03fc2881382a993 "datapath: Fix race."
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to