[ofa-general] Re: [PATCHv2 RESEND] IB/IPoIB: Don't let a bad muticast address in the join list stop subsequent joins

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Mon Aug 24 10:18:58 PDT 2009


On Mon, Aug 24, 2009 at 07:48:51PM +0300, Yossi Etigin wrote:

> Are you suggesting to sort the list each time we have add/remove a new entry,
> or search for the correct location to insert the new entry? I'm afraid that
> would add too much complexity and be inefficient (in O() terms).

1) This is an unlikely failure path 2) It is only O(n) to insert a
entry into the proper place in an already sorted linked list. 3) I
think you can do it about four lines of code.

list_for_each_entry_reverse(i,priv->multicast_list,list) {
   if (i->xx < mcast->xx || priv->multicast_list == i) {
       list_move(mcast->list,i->list);
       break;
   }
}

Which is actually O(1) in the most common cases.

> Moreover, I believe that moving a failed mcast entry to the end of
> the list behaves the same as always joining the least-backoff-value
> mcast entry (since everybody start with the same backoff).

Nope.. New entries can be added at any time which unsorts things.

Jason



More information about the general mailing list