Re: [RFC rdma-core] srp_daemon: handle SM lid change

Bart Van Assche
2017-12-08T16:41:06Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1099 bytes --]

On Fri, 2017-12-08 at 08:56 -0500, Dennis Dalessandro wrote:
> On 12/8/2017 8:33 AM, Hal Rosenstock wrote:
> > > int create_ah(struct ud_resources *ud_res)
> > > @@ -641,7 +649,7 @@ static int register_to_trap(struct sync_resources *sync_res,
> > > pthread_mutex_unlock(res->mad_buffer_mutex);
> > > } while (rc == 2); // while old response.
> > >
> > > - } while (rc == 0 && ++counter < 3);
> > > + } while (rc == 0 && ++counter < 5);
> > >
> > > if (counter==3) {
> >
> > This should be changed from 3 to 5 also. Change both to some define ?
>
> Yes please change these to a #define with a some what descriptive name.
> That would make the code much better to read.

It would be even better to change the loop such that it counts down instead
of up. Then the if-statement after the loop can test whether the counter has
reached zero and the constant that represents the number of iterations will
only occur once.

Bart.N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±­ÙšŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hš‹»öì\x17/oSc¾™Ú³9˜uÀ¦æå‰È&jw¨®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þ–Šàþf£¢·hšˆ§~ˆmš