[source] generic: make switch_port_stats tx/rx_bytes long long

LEDE Commits lede-commits at lists.infradead.org
Fri Sep 1 00:30:54 PDT 2017

blogic pushed a commit to source.git, branch master:

commit c30a70fc9fbc968fb0563feef0e661e46b65300f
Author: Thibaut VARENE <hacks at slashdirt.org>
AuthorDate: Fri Aug 4 12:32:04 2017 +0200

    generic: make switch_port_stats tx/rx_bytes long long
    This generic structure defines tx_bytes and rx_bytes as unsigned long (u32),
    while several devices would typically report unsigned long long (u64).
    The code can work as is, but there's a chance that with a sufficiently fast
    interface the overflow might happen too fast to be correctly noticed by the
    consumers of this data.
    This patch makes both field unsigned long long and updates the only known
    consumer of this data: swconfig_leds.c
    Signed-off-by: Thibaut VARENE <hacks at slashdirt.org>
 target/linux/generic/files/drivers/net/phy/swconfig_leds.c | 2 +-
 target/linux/generic/files/include/linux/switch.h          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
index dad3c39..20b9a12 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
@@ -36,7 +36,7 @@ struct switch_led_trigger {
 	struct delayed_work sw_led_work;
 	u32 port_mask;
 	u32 port_link;
-	unsigned long port_traffic[SWCONFIG_LED_NUM_PORTS];
+	unsigned long long port_traffic[SWCONFIG_LED_NUM_PORTS];
 	u8 link_speed[SWCONFIG_LED_NUM_PORTS];
diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h
index f8380b9..4e62384 100644
--- a/target/linux/generic/files/include/linux/switch.h
+++ b/target/linux/generic/files/include/linux/switch.h
@@ -59,8 +59,8 @@ struct switch_port_link {
 struct switch_port_stats {
-	unsigned long tx_bytes;
-	unsigned long rx_bytes;
+	unsigned long long tx_bytes;
+	unsigned long long rx_bytes;

More information about the lede-commits mailing list