Subject: Re: [RFC PATCH] llc: convert the socket list to RCU locking (was Re: [PATCH 3/4] llc: use a device based hash table to speed up multicast delivery)

From: Eric Dumazet <[email-masked]>
Date: Wed, 09 Dec 2009 23:34:37 +0100

Le 09/12/2009 22:49, Octavian Purdila a écrit :
> On Wednesday 09 December 2009 22:36:06 you wrote:
>  
>> I think I have everything  (in my head :) ) that I need now to come back
>>  with a v2 llc patch set now. 
> 
> Hmm, not really :) I still can't see how we can do multicast delivery only with RCU when we need to restart the lookup.
> 
> I think you mentioned that it is actually possible to do this for UDP, but I didn't found out how :-?

A patch is coming for this, it might need a seqlock (instead of a spinlock).

Do the list lookup and take a refcount on all matching sockets, store pointers in a 'stack'.

If lookup was sucessful, then multicast packet to all sockets present in stack.

> 
> Also, I think we need to restart the lookup even when only one list is used, when we found out that the object is either free or not the one we were looking for, since the current object might have been added to the end of the 
> list, thus short circuiting our search. E.g.:
> 

Not necessary, because a socket is always added at front of the list.

You have a guarantee that you examined all sockets at least once.

But it doesnt matter so much anyway, because you dont want a single list :)