Re: [PATCH] l2tp: cast l2tp traffic counter to unsigned

2017-06-10 Thread David Miller
From: Eric Dumazet Date: Fri, 09 Jun 2017 17:29:11 -0700 > On Fri, 2017-06-09 at 15:16 -0700, Stephen Hemminger wrote: >> On Fri, 9 Jun 2017 16:29:47 +0200 >> Dominik Heidler wrote: >> >> > This fixes a counter problem on 32bit systems: >> > When the

Re: [PATCH] l2tp: cast l2tp traffic counter to unsigned

2017-06-09 Thread Eric Dumazet
On Fri, 2017-06-09 at 15:16 -0700, Stephen Hemminger wrote: > On Fri, 9 Jun 2017 16:29:47 +0200 > Dominik Heidler wrote: > > > This fixes a counter problem on 32bit systems: > > When the rx_bytes counter reached 2 GiB, it jumpd to (2^64 Bytes - 2GiB) > > Bytes. > > > >

Re: [PATCH] l2tp: cast l2tp traffic counter to unsigned

2017-06-09 Thread Stephen Hemminger
On Fri, 9 Jun 2017 16:29:47 +0200 Dominik Heidler wrote: > This fixes a counter problem on 32bit systems: > When the rx_bytes counter reached 2 GiB, it jumpd to (2^64 Bytes - 2GiB) > Bytes. > > rtnl_link_stats64 has __u64 type and atomic_long_read returns > atomic_long_t

[PATCH] l2tp: cast l2tp traffic counter to unsigned

2017-06-09 Thread Dominik Heidler
This fixes a counter problem on 32bit systems: When the rx_bytes counter reached 2 GiB, it jumpd to (2^64 Bytes - 2GiB) Bytes. rtnl_link_stats64 has __u64 type and atomic_long_read returns atomic_long_t which is signed. Due to the conversation we get an incorrect value on 32bit systems if the MSB