Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Martin KaFai Lau
On Thu, Apr 20, 2017 at 08:00:41AM -0700, Eric Dumazet wrote: > On Thu, 2017-04-20 at 07:15 -0700, Martin KaFai Lau wrote: > > > A follow-up patch approach by Gal will be nice. > > Note that I had a similar issue on mlx4. > > Stats are cleared/reset at open time, but in an asynchronous way. > >

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Eric Dumazet
On Thu, 2017-04-20 at 07:15 -0700, Martin KaFai Lau wrote: > A follow-up patch approach by Gal will be nice. Note that I had a similar issue on mlx4. Stats are cleared/reset at open time, but in an asynchronous way. Using a bonding device ( and fix in

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Saeed Mahameed
On Thu, Apr 20, 2017 at 5:15 PM, Martin KaFai Lau wrote: > On Thu, Apr 20, 2017 at 05:00:13PM +0300, Saeed Mahameed wrote: >> On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: >> > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes >> > reported

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Martin KaFai Lau
On Thu, Apr 20, 2017 at 05:00:13PM +0300, Saeed Mahameed wrote: > On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: > > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes > > reported under /proc/net/dev. There is a race in mlx5e_update_stats() > > and some of

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Saeed Mahameed
On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes > reported under /proc/net/dev. There is a race in mlx5e_update_stats() > and some of the get-stats functions (the one that we hit is the > mlx5e_get_stats()

[PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-19 Thread Martin KaFai Lau
We have observed a sudden spike in rx/tx_packets and rx/tx_bytes reported under /proc/net/dev. There is a race in mlx5e_update_stats() and some of the get-stats functions (the one that we hit is the mlx5e_get_stats() which is called by ndo_get_stats64()). In particular, the very first thing