net: dsa: mt7530: implement .get_stats64
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 10 Apr 2025 16:30:14 +0000 (18:30 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 15 Apr 2025 10:10:21 +0000 (12:10 +0200)
commit88c810f35ed543dc3ddc3e4d888d89f9e8ecd7cb
tree04e2b87840b91e3a2325710c85f66154639469be
parentc3b904c6dd814507c70c2c5c24b3ba359ff41d0a
net: dsa: mt7530: implement .get_stats64

It was reported that the internally calculated counter might differ from
the real one from the Switch MIB. This can happen if the switch directly
forward packets between the ports or offload small packets like ARP
request. In such case, the kernel counter will desync compared to the
real one transmitted and received by the Switch.

To correctly provide the real info to the kernel, implement .get_stats64
that will directly read the current MIB counter from the switch
register.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20250410163022.3695-7-ansuelsmth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/mt7530.c