From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 561F4A00C5; Tue, 7 Jul 2020 01:01:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF5A71DBD9; Tue, 7 Jul 2020 01:01:23 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 60DD31DBD5 for ; Tue, 7 Jul 2020 01:01:21 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 91E7C5C0192; Mon, 6 Jul 2020 19:01:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 06 Jul 2020 19:01:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 4kD4jQEL9IhzN1haPCMcYMbjY2ooWyNYmXt+3AMZ0K8=; b=PFdb1l7BX3EcWO6Z Lte1VRm+n284LoF1MPfkbgYBNTi14/Sc9xJ0EGBIfOEGq1YMqJUnhgm4qzJ/xJYf HTQyQ9usUC51ZCuN97rn6HBWLK2NEOvCFtgd5MTcz769sNwFRFWGSdknrei4CdKE MqXPuF468HBuacoF7TTZ8pBaHHw2puN/BKfJFXKTHltt/N72xFsLH44i8PTdeHIK aixB6n9eRjyEXFw8QCkii5lmvII9i8bP579G4us4Xv9kpqUgs9MQLhVpm2uwr0lr +1rWoIf31u0w8EpL/7kL4xGUYpJdh9bu4syUDKMLXXAtFcoxmo74wdChtXSkWvrM IL5OgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=4kD4jQEL9IhzN1haPCMcYMbjY2ooWyNYmXt+3AMZ0 K8=; b=Y5gPT2rH3YyrpiPCjJ79MQo1ouIaS9FIzBoUW1DZzw7y1SQbH9lzhs4uv kopw/52oz7eqfn+8nlmexQEhWN0V1tQdqkH2pJHjl9e5chmjktRtKLFbaQUi+zvU yDUD11aJk9qtc8ekxR/Put7kzp/mxmIYkKW2tOVzLWmRT5Vdb85lBv4PRXoairiq O32vxYfczgb0sBWqSum1Ajc6RJyum/VMOYBmDRpYTNLmFPXOIzxWiesMzkN+xaDZ Sf2qvIt2MDuqe30srSnx7l/ZPdsStiXxhbL3A67TALp4qclvGa30exD+XiVlvMF3 0RUK6GXNr/iTBg5IC/v8LHwklI8aQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeggddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 64BA73280066; Mon, 6 Jul 2020 19:01:19 -0400 (EDT) From: Thomas Monjalon To: Alan Dewar Cc: "dev@dpdk.org" , "alangordondewar@gmail.com" , "Dumitrescu, Cristian" , "Singh, Jasvinder" Date: Tue, 07 Jul 2020 01:01:17 +0200 Message-ID: <1904548.GDZOGqOs03@thomas> In-Reply-To: References: <20200416084821.12591-1-alan.dewar@att.com> <1765563.QPqcEuCtyy@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] sched: fix port time rounding error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > 25/06/2020 11:59, alangordondewar@gmail.com: > > > From: Alan Dewar > > > > > > The QoS scheduler works off port time that is computed from the number > > > of CPU cycles that have elapsed since the last time the port was > > > polled. It divides the number of elapsed cycles to calculate how > > > many bytes can be sent, however this division can generate rounding > > > errors, where some fraction of a byte sent may be lost. > > > > > > Lose enough of these fractional bytes and the QoS scheduler > > > underperforms. The problem is worse with low bandwidths. > > > > > > To compensate for this rounding error this fix doesn't advance the > > > port's time_cpu_cycles by the number of cycles that have elapsed, but > > > by multiplying the computed number of bytes that can be sent (which > > > has been rounded down) by number of cycles per byte. > > > This will mean that port's time_cpu_cycles will lag behind the CPU > > > cycles momentarily. At the next poll, the lag will be taken into > > > account. > > > > > > v2: > > > If the cycles value wraps (100 year+) reset the port's cpu cycle back > > > to zero. > > > > > > Fixes: de3cfa2c98 ("sched: initial import") > > > > > > Signed-off-by: Alan Dewar > > Acked-by: Jasvinder Singh Applied, thanks