]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Initialize netdev's module overheat counter
authorAmit Cohen <amcohen@nvidia.com>
Sun, 27 Sep 2020 07:50:13 +0000 (10:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2020 20:27:01 +0000 (13:27 -0700)
commit3bdbab3fee87e7d2b29a61ea55808ae9d993f1d2
tree5861751ef8f17490555cf1284014e56999b1eb85
parentf21b1a646f812ccc2e56f0d5c804b64f0043ea78
mlxsw: spectrum: Initialize netdev's module overheat counter

The overheat counter is a per-module counter, but it is exposed as part
of the corresponding netdev's statistics. It should therefore be
presented to user space relative to the netdev's lifetime.

Query the counter just before registering the netdev, so that the value
exposed to user space will be relative to this initial value.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h