net: dsa: mv88e6xxx: Fix u64 statistics [Linux 5.0]

net: dsa: mv88e6xxx: Fix u64 statistics [Linux 5.0]

This Linux kernel change "net: dsa: mv88e6xxx: Fix u64 statistics" is included in the Linux 5.0 release. This change is authored by Andrew Lunn <andrew [at] lunn.ch> on Thu Feb 28 18:14:03 2019 +0100. The commit for this change in Linux stable tree is 6e46e2d (patch).

net: dsa: mv88e6xxx: Fix u64 statistics

The switch maintains u64 counters for the number of octets sent and
received. These are kept as two u32's which need to be combined.  Fix
the combing, which wrongly worked on u16's.

Fixes: 80c4627b2719 ("dsa: mv88x6xxx: Refactor getting a single statistic")
Reported-by: Chris Healy <[email protected]>
Signed-off-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 12fd7ce..9d36d2b 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -896,7 +896,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip,
    default:
        return U64_MAX;
    }
-   value = (((u64)high) << 16) | low;
+   value = (((u64)high) << 32) | low;
    return value;
 }

Leave a Reply

Your email address will not be published. Required fields are marked *