Message ID | 956f27fc5a2d4f99a553c18c82d3c3e0@jd.com |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev] 答复: [PATCH OVS 4/4] revert: dpif-netdev: includes microsecond delta in meter bucket calculation | expand |
On Fri, May 8, 2020 at 1:11 AM 姜立东 <jianglidong3@jd.com> wrote: > > Oh, this is due to patch porting from 2.10. > Between latest and 2.10, commit 42697ca77 is introduced to fix millisecond token insertion rate as below. > /* All packets will hit the meter at the same time. */ > - long_delta_t = (now - meter->used) / 1000; /* msec */ > + long_delta_t = now / 1000 - meter->used / 1000; /* msec */ > > While my patch is ported from 2.10 base line, so additional token is counted incorrectly. > Commit 42697ca77 is good enough to fix the loss of token in delta computation. > So we are looking into if higher token insertion rate in micro second is needed in some cases. > Thanks, I forgot this is already fixed. I will revert the patch if no other comments. William
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 104347d8b251..cf10b5a62423 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -5902,7 +5902,6 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, struct dp_packet *packet; long long int long_delta_t; /* msec */ uint32_t delta_t; /* msec */ - uint32_t delta_in_us; /* usec */ const size_t cnt = dp_packet_batch_size(packets_); uint32_t bytes, volume; int exceeded_band[NETDEV_MAX_BURST]; @@ -5933,9 +5932,6 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_,