From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E2765A06CE for ; Wed, 17 Apr 2019 10:46:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 638AA1B5DB; Wed, 17 Apr 2019 10:46:08 +0200 (CEST) Received: from vsmx012.vodafonemail.xion.oxcs.net (vsmx012.vodafonemail.xion.oxcs.net [153.92.174.90]) by dpdk.org (Postfix) with ESMTP id 843041B49A; Tue, 16 Apr 2019 11:20:34 +0200 (CEST) Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 161FEF34FB6; Tue, 16 Apr 2019 09:20:34 +0000 (UTC) Received: from H270 (unknown [91.56.240.67]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 3396A19A968; Tue, 16 Apr 2019 09:20:23 +0000 (UTC) Message-ID: <2851514C9E0449B4BA5C564727084D68@H270> From: "Stefan Kanthak" To: , Cc: , "Pavan Nikhilesh" , References: <20190414052325.15984-1-pbhagavatula@marvell.com> In-Reply-To: <20190414052325.15984-1-pbhagavatula@marvell.com> Date: Tue, 16 Apr 2019 11:07:47 +0200 Organization: Me, myself & IT MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.24158 X-VADE-STATUS: LEGIT X-Mailman-Approved-At: Wed, 17 Apr 2019 10:46:07 +0200 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal: fix large multiple calculation in reciprocal division X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Pavan Nikhilesh wrote Sunday, April 14, 2019 7:22 AM: > From: Pavan Nikhilesh > > Fix large multiple calculation in 64 bit reciprocal division. This "fix" has a SERIOUS bug, it needs yet another fix. I recommend to understand code first before you copy it! [...] > + int64_t i; uint i = 64; > + uint64_t t; > + > + for (i = 1; i <= 64; i++) { do { > + t = x >> 63; t = (int64_t) x >> 63; // t is either 0ULL or ~0ULL > + x = (x << 1) | (y >> 63); > + y = y << 1; > + if ((x | t) >= z) { > + x = x - z; > + y = y + 1; > + } } while (--i > 0); Stefan Kanthak