[ofa-general] Re: [PATCHv2] osm: up/dn optimization - improved ranking

Sasha Khapyorsky sashak at voltaire.com
Thu May 24 15:54:28 PDT 2007


Hi Yevgeny,

On 11:17 Mon 21 May     , Yevgeny Kliteynik wrote:
> >>@@ -492,7 +483,10 @@ updn_subn_rank(
> >>                 remote_u->rank );
> >>
> >>        if (did_cause_update)
> >>+        {
> >>          cl_qlist_insert_tail(&list, &remote_u->list);
> >>+          max_rank = remote_u->rank;
> >>+        }
> >
> >I think this still be not accurate. For instance with topology like:
> >A <-> B <-> C <-> D <-> E , where roots are A and E we will get
> >max_rank= 1, which obviously should be 2.
> 
> Not exactly. What you're describing would happen if the scan would be 
> DFS-like,
> not BFS.

You are right, I used broken logic :(

> I do 
> think that
> to make the code more "intuitive" we might want to remove the 
> __updn_update_rank()
> and do something like this:
> 
>    if (remote_u->rank > u->rank + 1)
>    {
>        remote_u->rank = u->rank + 1;
>        max_rank = remote_u->rank; 
>        cl_qlist_insert_tail(&list, &remote_u->list);
>    }

Agree, it looks cleaner.

Sasha



More information about the general mailing list