patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Stefan Kanthak" <stefan.kanthak@nexgo.de>
To: <pbhagavatula@marvell.com>, <jerinj@marvell.com>
Cc: <dev@dpdk.org>, "Pavan Nikhilesh" <pbhagavatula@marvell.com>,
	<stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal: fix large multiple calculation in reciprocal division
Date: Tue, 16 Apr 2019 11:07:47 +0200	[thread overview]
Message-ID: <2851514C9E0449B4BA5C564727084D68@H270> (raw)
In-Reply-To: <20190414052325.15984-1-pbhagavatula@marvell.com>

Pavan Nikhilesh <pbhagavatula@marvell.com> wrote Sunday, April 14, 2019 7:22 AM:


> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> 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

      parent reply	other threads:[~2019-04-17  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14  5:22 pbhagavatula
2019-04-15 15:44 ` Stephen Hemminger
2019-04-16  9:07 ` Stefan Kanthak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2851514C9E0449B4BA5C564727084D68@H270 \
    --to=stefan.kanthak@nexgo.de \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).