Re: [PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation backoff

2016-09-27 Thread Hannes Frederic Sowa
[cc Vishwanath Pai] On 27.09.2016 11:42, Maciej Żenczykowski wrote: >> Please just use do_div here and go back to the first version of the >> patch. Variable names could be more aligned with the RFC maybe? > > So I tried: > > static inline s32 rfc3315_s14_backoff_init(s32 irt) > { >/* m

Re: [PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation backoff

2016-09-27 Thread Hannes Frederic Sowa
On 27.09.2016 11:42, Maciej Żenczykowski wrote: >> Please just use do_div here and go back to the first version of the >> patch. Variable names could be more aligned with the RFC maybe? > > So I tried: > > static inline s32 rfc3315_s14_backoff_init(s32 irt) > { >/* multiply 'initial retr

Re: [PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation backoff

2016-09-27 Thread Maciej Żenczykowski
> Please just use do_div here and go back to the first version of the > patch. Variable names could be more aligned with the RFC maybe? So I tried: static inline s32 rfc3315_s14_backoff_init(s32 irt) { /* multiply 'initial retransmission time' by 0.9 .. 1.1 */ u64 tmp = (90 + p

Re: [PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation backoff

2016-09-26 Thread Hannes Frederic Sowa
On 25.09.2016 13:03, Maciej Żenczykowski wrote: > +static inline s32 rfc3315_s14_backoff_init(s32 initial) > +{ > + u32 r = (9 << 20) / 10 + (prandom_u32() % ((2 << 20) / 10 + 1)); ^ > + s32 v = initial * (u64)r >> 20; /* ~ multiply by 0.9 .. 1.1 */ > + return v; > +} > + > +sta

[PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation backoff

2016-09-25 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This implements: https://tools.ietf.org/html/rfc7559 Backoff is performed according to RFC3315 section 14: https://tools.ietf.org/html/rfc3315#section-14 Signed-off-by: Maciej Żenczykowski --- include/net/if_inet6.h | 1 + net/ipv6/addrconf.c| 31 +++