From patchwork Thu Aug 24 12:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lance Richardson X-Patchwork-Id: 805466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xdNR55fRWz9sDB for ; Thu, 24 Aug 2017 22:10:24 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 19DC9899; Thu, 24 Aug 2017 12:10:20 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 810DF499; Thu, 24 Aug 2017 12:10:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 69B5F1FB; Thu, 24 Aug 2017 12:10:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C41B0356E6; Thu, 24 Aug 2017 12:10:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C41B0356E6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lrichard@redhat.com Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB06E7F1B9; Thu, 24 Aug 2017 12:10:17 +0000 (UTC) Received: from zmail26.collab.prod.int.phx2.redhat.com (zmail26.collab.prod.int.phx2.redhat.com [10.5.83.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A1DA0180884F; Thu, 24 Aug 2017 12:10:17 +0000 (UTC) Date: Thu, 24 Aug 2017 08:10:15 -0400 (EDT) From: Lance Richardson To: =?utf-8?B?546L5b+X5YWL?= Message-ID: <490755984.1332121.1503576615786.JavaMail.zimbra@redhat.com> In-Reply-To: <6DAF063A35010343823807B082E5681F1A72EB30@mbx05.360buyAD.local> References: <6DAF063A35010343823807B082E5681F1A72EB30@mbx05.360buyAD.local> MIME-Version: 1.0 X-Originating-IP: [10.10.120.48, 10.4.195.24] Thread-Topic: OVS+DPDK QoS rate limit issue Thread-Index: AdMcic49TTWvpXYkRXiMjMCWFEh4bKoMxDSt X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 24 Aug 2017 12:10:17 +0000 (UTC) Cc: ovs-dev@openvswitch.org, ovs-discuss@openvswitch.org Subject: Re: [ovs-dev] [ovs-discuss] OVS+DPDK QoS rate limit issue X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org > From: "王志克" > To: ovs-dev@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? Regards, Lance Richardson > > Br, > > Wang Zhike > > _______________________________________________ > discuss mailing list > discuss@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-discuss > 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;