OSDN Git Service

net: mvpp2: fix GOP statistics loop start and stop conditions
authorMiquel Raynal <miquel.raynal@free-electrons.com>
Wed, 8 Nov 2017 07:59:40 +0000 (08:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Nov 2017 06:21:30 +0000 (15:21 +0900)
commite5c500eb298a9f5ef9b80d16fcea9662c89467b7
treefb8debc9c21d37cf9195a72d26c4270d97d41800
parentfc98135928912f85e27ee41cafebf0a6cf326d0e
net: mvpp2: fix GOP statistics loop start and stop conditions

GOP statistics from all ports of one instance of the driver are gathered
with one work recalled in loop in a workqueue. The loop is started when
a port is up, and stopped when a port is down. This last condition is
obviously wrong.

Fix this by having a work per port. This way, starting and stoping it
when the port is up or down will be fine, while minimizing unnecessary
CPU usage.

Fixes: 118d6298f6f0 ("net: mvpp2: add ethtool GOP statistics")
Reported-by: Stefan Chulski <stefanc@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c