hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/net/core/gen_estimator.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * net/sched/gen_estimator.c Simple rate estimator.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 *
95 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
106 * Eric Dumazet <edumazet@google.com>
....@@ -52,7 +48,7 @@
5248 u8 intvl_log; /* period : (250ms << intvl_log) */
5349
5450 seqcount_t seq;
55
- u32 last_packets;
51
+ u64 last_packets;
5652 u64 last_bytes;
5753
5854 u64 avpps;
....@@ -87,7 +83,7 @@
8783 brate = (b.bytes - est->last_bytes) << (10 - est->intvl_log);
8884 brate = (brate >> est->ewma_log) - (est->avbps >> est->ewma_log);
8985
90
- rate = (u64)(b.packets - est->last_packets) << (10 - est->intvl_log);
86
+ rate = (b.packets - est->last_packets) << (10 - est->intvl_log);
9187 rate = (rate >> est->ewma_log) - (est->avpps >> est->ewma_log);
9288
9389 write_seqcount_begin(&est->seq);