[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19f0c2696eb4419cad21e20fe6d54bcb@AcuMS.aculab.com>
Date: Fri, 22 Sep 2023 16:51:08 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <edumazet@...gle.com>
CC: David Ahern <dsahern@...nel.org>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Soheil Hassas Yeganeh <soheil@...gle.com>, Neal Cardwell
<ncardwell@...gle.com>, Yuchung Cheng <ycheng@...gle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "eric.dumazet@...il.com"
<eric.dumazet@...il.com>
Subject: RE: [PATCH net-next 3/3] tcp: derive delack_max from rto_min
From: Eric Dumazet
> Sent: 22 September 2023 11:53
>
> On Fri, Sep 22, 2023 at 11:59 AM David Laight <David.Laight@...lab.com> wrote:
> >
> > From: Eric Dumazet
> > > Sent: 21 September 2023 13:58
> > >
> > > On Thu, Sep 21, 2023 at 2:37 PM David Ahern <dsahern@...nel.org> wrote:
> > > >
> > >
> > > > My comment is solely about mismatch on data types. I am surprised use of
> > > > max_t with mixed data types does not throw a compiler warning.
> > >
> > > This was intentional.
> > >
> > > This is max_t() purpose really.
> >
> > Apart from when it gets used to accidentally mask high bits :-)
> > (Although hat is usually consigned to min_t()).
>
> As explained, this is not an accident, but a conscious decision I made.
>
> >
> > Here
> > u32 delack_from_rto_min = max(rto_min, 2u) - 1;
> > would probably be safer (as in have no casts that might have
> > unwanted side effects).
> >
>
> I find my solution more readable.
It has to be said I didn't really like mine either :-)
A better alternative would be:
max((int)rto_min - 1, 1)
to make it absolutely clear what is going on.
Far too many of the min_t() and max_t() are just used to silence
the over-enthusiastic type checking of min() and max().
So code doing something different might be best making it more obvious.
Does 'ip route' stop very large values for rto_min?
Unsigned values with the top bit set might cause 'interesting' behaviour!
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists