> From: "王志克" <wangzh...@jd.com> > To: ovs-...@openvswitch.org, ovs-discuss@openvswitch.org > Sent: Wednesday, August 23, 2017 11:41:05 PM > Subject: [ovs-discuss] OVS+DPDK QoS rate limit issue > > > > Hi All, > > > > I am using OVS2.7.0 and DPDK 16.11, and testing rate limit function. > > > > I found that if the policing_rate is set very large, say 5Gbps, the rate is > limited dramatically to very low value, like 800Mbps. > > The command is as below: > > ovs-vsctl set interface port-7zel2so9sg ingress_policing_rate=5000000 > ingress_policing_burst=500000 > > > > If we set the rate lower than 4Gbps, the rate is limited correctly. > > > > Test setup: > > Sender (DPDK pktGen) sends out about 10Gbps udp packet, with size about 1420 > IP size. > > The rate limit is set on VM vhost-user-client port. > > > > Any idea about this issue? Is that known issue? > >
It seems 32-bit arithmetic is being used when converting the rate from kilobits per second to bytes per second. Could you give this patch a try? diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 1aaf6f7e2..d6ed2c7b0 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2229,8 +2229,8 @@ netdev_dpdk_policer_construct(uint32_t rate, uint32_t burst) rte_spinlock_init(&policer->policer_lock); /* rte_meter requires bytes so convert kbits rate and burst to bytes. */ - rate_bytes = rate * 1000/8; - burst_bytes = burst * 1000/8; + rate_bytes = rate * 1000ULL/8; + burst_bytes = burst * 1000ULL/8; policer->app_srtcm_params.cir = rate_bytes; policer->app_srtcm_params.cbs = burst_bytes; Regards, Lance Richardson > > Br, > > Wang Zhike > > _______________________________________________ > discuss mailing list > disc...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-discuss > _______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss