]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
eth: fbnic: Fetch PHY stats from device
authorMohsin Bashir <mohsin.bashr@gmail.com>
Mon, 25 Aug 2025 20:02:04 +0000 (13:02 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Aug 2025 01:56:19 +0000 (18:56 -0700)
commitdf4c5d9a290eec592239d1d9591189b5c4cce9ab
treef04d2d31b28c1686658b7e2ba44d39d87fce4a2a
parentbcf54e5d7cd0dccf6378e00f1f6ddff28b9f3989
eth: fbnic: Fetch PHY stats from device

Add support to fetch PHY stats consisting of PCS and FEC stats from the
device. When reading the stats counters, the lo part is read first, which
latches the hi part to ensure consistent reading of the stats counter.

FEC and PCS stats can wrap depending on the access frequency. To prevent
wrapping, fetch these stats periodically under the service task. Also to
maintain consistency fetch these stats along with other 32b stats under
__fbnic_get_hw_stats32().

Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250825200206.2357713-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/meta/fbnic/fbnic_csr.h
drivers/net/ethernet/meta/fbnic/fbnic_hw_stats.c
drivers/net/ethernet/meta/fbnic/fbnic_hw_stats.h
drivers/net/ethernet/meta/fbnic/fbnic_mac.c
drivers/net/ethernet/meta/fbnic/fbnic_mac.h