All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: use reciprocal_divide instead of reimplementing it
Date: Tue, 03 Sep 2013 16:35:35 +0200	[thread overview]
Message-ID: <5225F3B7.2000202@redhat.com> (raw)
In-Reply-To: <1378216954.7360.25.camel@edumazet-glaptop>

On 09/03/2013 04:02 PM, Eric Dumazet wrote:
> On Tue, 2013-09-03 at 12:26 +0200, Daniel Borkmann wrote:
>> Replace these places with reciprocal_divide() inline function instead of
>> reimplementing it each time, thus it will become easier to read. We do not
>> need to explicitly include its header as it's pulled in from linux/net.h
>> anyway.
>
> Sure, (((u64) hash * qcount) >> 32) happens to be
> reciprocal_divide(hash, qcount) but the result depends on hash being
> well distributed in [0 .. ~0U] space.
>
> So 'reciprocal' and 'divide' do not accurately describe this exact
> operation.
>
> I suggest making the thing more descriptive.
>
> (And discussed on lkml btw)

Sure, we can do that. Then lets drop these two for now.

      reply	other threads:[~2013-09-03 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 10:26 [PATCH net-next 0/2] net_random_N, reciprocal_divide helper updates Daniel Borkmann
2013-09-03 10:26 ` [PATCH net-next 1/2] net: introduce generic net_random_N helper Daniel Borkmann
2013-09-03 11:00   ` Joe Perches
2013-09-03 11:40     ` Daniel Borkmann
2013-09-03 12:15       ` Joe Perches
2013-09-03 12:26         ` Daniel Borkmann
2013-09-03 12:41           ` Joe Perches
2013-09-03 13:59   ` Eric Dumazet
2013-09-03 10:26 ` [PATCH net-next 2/2] net: use reciprocal_divide instead of reimplementing it Daniel Borkmann
2013-09-03 14:02   ` Eric Dumazet
2013-09-03 14:35     ` Daniel Borkmann [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=5225F3B7.2000202@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.