.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
8 | 4 | * |
---|
9 | 5 | * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> |
---|
10 | 6 | * Eric Dumazet <edumazet@google.com> |
---|
.. | .. |
---|
52 | 48 | u8 intvl_log; /* period : (250ms << intvl_log) */ |
---|
53 | 49 | |
---|
54 | 50 | seqcount_t seq; |
---|
55 | | - u32 last_packets; |
---|
| 51 | + u64 last_packets; |
---|
56 | 52 | u64 last_bytes; |
---|
57 | 53 | |
---|
58 | 54 | u64 avpps; |
---|
.. | .. |
---|
87 | 83 | brate = (b.bytes - est->last_bytes) << (10 - est->intvl_log); |
---|
88 | 84 | brate = (brate >> est->ewma_log) - (est->avbps >> est->ewma_log); |
---|
89 | 85 | |
---|
90 | | - rate = (u64)(b.packets - est->last_packets) << (10 - est->intvl_log); |
---|
| 86 | + rate = (b.packets - est->last_packets) << (10 - est->intvl_log); |
---|
91 | 87 | rate = (rate >> est->ewma_log) - (est->avpps >> est->ewma_log); |
---|
92 | 88 | |
---|
93 | 89 | write_seqcount_begin(&est->seq); |
---|