]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_en: Fill all counters under one call of stats lock
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 13 Dec 2017 16:12:11 +0000 (18:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2017 21:38:37 +0000 (16:38 -0500)
commit0e57a571b2548f320c0236baa754f5363345f775
treee81bc4358cdff998de373296af7ffee5320cb7cf
parentaf7403a4c832ab4b13bf7cf2ea131a08a5977641
net/mlx4_en: Fill all counters under one call of stats lock

Before this patch, the stats_lock was acquired twice. In between the
locks Driver sent command to gather some more statistics (per priority
and counter statistics). If the stats lock was acquired by get
statistics NDO in between we would have report out of sync counters.

Fix this by collecting all stats from Firmware in advance and then
fill the Software structs under one lock.

Fixes: 08fc03961acf ("net/mlx4_en: Add Flow control statistics display via ethtool")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_port.c