]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.9/net-dsa-mv88e6xxx-fix-u64-statistics.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / net-dsa-mv88e6xxx-fix-u64-statistics.patch
1 From foo@baz Fri Mar 8 09:51:16 CET 2019
2 From: Andrew Lunn <andrew@lunn.ch>
3 Date: Thu, 28 Feb 2019 18:14:03 +0100
4 Subject: net: dsa: mv88e6xxx: Fix u64 statistics
5
6 From: Andrew Lunn <andrew@lunn.ch>
7
8 [ Upstream commit 6e46e2d821bb22b285ae8187959096b65d063b0d ]
9
10 The switch maintains u64 counters for the number of octets sent and
11 received. These are kept as two u32's which need to be combined. Fix
12 the combing, which wrongly worked on u16's.
13
14 Fixes: 80c4627b2719 ("dsa: mv88x6xxx: Refactor getting a single statistic")
15 Reported-by: Chris Healy <Chris.Healy@zii.aero>
16 Signed-off-by: Andrew Lunn <andrew@lunn.ch>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 --- a/drivers/net/dsa/mv88e6xxx/chip.c
24 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
25 @@ -798,7 +798,7 @@ static uint64_t _mv88e6xxx_get_ethtool_s
26 if (s->sizeof_stat == 8)
27 _mv88e6xxx_stats_read(chip, s->reg + 1, &high);
28 }
29 - value = (((u64)high) << 16) | low;
30 + value = (((u64)high) << 32) | low;
31 return value;
32 }
33