summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2020-05-23 18:33:20 +0800
committerIlya Maximets <i.maximets@ovn.org>2020-07-27 13:30:11 +0200
commita4953c5fe37fbd108d276ca75c31d4ae7d06a62b (patch)
tree243026e8efccfbbfcce1d3a6564b6782d96ba4d2 /lib
parent850e834fa0ff0e40fb72140f0a7c40491c926e23 (diff)
downloadopenvswitch-a4953c5fe37fbd108d276ca75c31d4ae7d06a62b.tar.gz
Revert "dpif-netdev: includes microsecond delta in meter bucket calculation".
This reverts commit 5c41c31ebd64fda821fb733a5784a7a440a794f8. Use the pktgen-dpdk to test the commit 5c41c31ebd64 ("dpif-netdev: includes microsecond delta in meter bucket calculation"), it does't work as expected. And it broken the meter function (e.g. set rate 200Mbps, the rate watched was 400Mbps). To reproduce it: $ ovs-vsctl add-br br-int -- set bridge br-int datapath_type=netdev $ ovs-ofctl -O OpenFlow13 add-meter br-int \ "meter=100 kbps burst stats bands=type=drop rate=200000 burst_size=200000" $ ovs-ofctl -O OpenFlow13 add-flow br-int \ "in_port=dpdk0 action=meter:100,output:dpdk1" $ pktgen -l 1,3,5,7,9,11,13,15,17,19 -n 8 --socket-mem 4096 \ --file-prefix pg1 -w 0000:82:00.0 -w 0000:82:00.1 -- \ -T -P -m "[3/5/7/9/11/13/15].[0-1]" -f meter-test.pkt meter-test.pkt: | set 0 count 0 | set 0 size 1500 | set 0 rate 100 | set 0 burst 64 | set 0 sport 1234 | set 0 dport 5678 | set 0 prime 1 | set 0 type ipv4 | set 0 proto udp | set 0 dst ip 1.1.1.2 | set 0 src ip 1.1.1.1/24 | set 0 dst mac ec:0d:9a:ab:54:0a | set 0 src mac ec:0d:9a:bf:df:bb | set 0 vlanid 0 | start 0 Note that the issue that patch 5c41c31ebd64 was intended to fix was already fixed by commit: 42697ca7757b ("dpif-netdev: fix meter at high packet rate.") Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-netdev.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2aad24511..02df8f11e 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -6095,7 +6095,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];
@@ -6126,9 +6125,6 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_,
Assuming that all racing threads received packets at the same time
to avoid overflow. */
long_delta_t = 0;
- delta_in_us = 0;
- } else {
- delta_in_us = (now - meter->used) % 1000;
}
/* Make sure delta_t will not be too large, so that bucket will not
@@ -6164,7 +6160,6 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_,
/* Update band's bucket. */
band->bucket += delta_t * band->up.rate;
- band->bucket += delta_in_us * band->up.rate / 1000;
if (band->bucket > band->up.burst_size) {
band->bucket = band->up.burst_size;
}