netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, Changli Gao <xiaosuo@gmail.com>,
	Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: remove modulo operations
Date: Sun, 24 Oct 2010 22:44:12 +0200	[thread overview]
Message-ID: <20101024204412.GN15247@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <1287947511.2658.1678.camel@edumazet-laptop>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le dimanche 24 octobre 2010 à 20:25 +0200, Florian Westphal a écrit :
> > I'd imagine that the result of ((hash * total) >> 32) is (almost)
> > always zero, especially if total is small (which it is usually).
> > 
> 
> Absolutely not. total is a 32bit number, using full range.
> 
> > Did you test that this change does not affect distribution average?
> 
> That would be shocking actually, given we use jhash()
> 
> I did same tricks in various parts of network stack in the past, and its
> fine.

Yes, you are right.  I tested this change and it is OK.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-10-24 20:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24  3:40 [PATCH] netfilter: remove modulo operations Changli Gao
2010-10-24 18:25 ` Florian Westphal
2010-10-24 19:11   ` Eric Dumazet
2010-10-24 20:44     ` Florian Westphal [this message]
2010-10-24 21:49     ` Maciej Żenczykowski
2010-10-25  3:02     ` Jan Engelhardt
2010-10-25  3:19       ` Maciej Żenczykowski
2010-10-25  9:13         ` Jan Engelhardt
2010-10-25  9:28           ` Jan Engelhardt
2010-10-25  9:26 ` Eric Dumazet
2010-10-25 15:39   ` Patrick McHardy

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=20101024204412.GN15247@Chamillionaire.breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=xiaosuo@gmail.com \
    /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).