mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
net: openvswitch: use u64 for meter bucket
When setting the meter rate to 4+Gbps, there is an overflow, the meters don't work as expected. Cc: Pravin B Shelar <[email protected]> Cc: Andy Zhou <[email protected]> Signed-off-by: Tonghao Zhang <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
c773500890
commit
e57358873b
2 files changed
+2
-2
No files matched your search
@@ -392,7 +392,7 @@ static struct dp_meter *dp_meter_create(struct nlattr **a)
|
||||
*
|
||||
* Start with a full bucket.
|
||||
*/
|
||||
band->bucket = (band->burst_size + band->rate) * 1000;
|
||||
band->bucket = (band->burst_size + band->rate) * 1000ULL;
|
||||
band_max_delta_t = band->bucket / band->rate;
|
||||
if (band_max_delta_t > meter->max_delta_t)
|
||||
meter->max_delta_t = band_max_delta_t;
|
||||
|
||||
@@ -26,7 +26,7 @@ struct dp_meter_band {
|
||||
u32 type;
|
||||
u32 rate;
|
||||
u32 burst_size;
|
||||
u32 bucket; /* 1/1000 packets, or in bits */
|
||||
u64 bucket; /* 1/1000 packets, or in bits */
|
||||
struct ovs_flow_stats stats;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user