From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: Tom Herbert <therbert@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
netdev@markandruth.co.uk, eric.dumazet@gmail.com
Subject: Re: [PATCH 2/5 v2] soreuseport: TCP/IPv4 implementation
Date: Mon, 21 Jan 2013 11:30:25 +0900 [thread overview]
Message-ID: <50FCA841.8020109@linux-ipv6.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1301201542510.834@pokey.mtv.corp.google.com>
Tom Herbert wrote:
> + } else if (score == hiscore && reuseport) {
> + matches++;
> + if (((u64)phash * matches) >> 32 == 0)
> + result = sk;
> + phash = next_pseudo_random32(phash);
> }
> }
> /*
Well, honestly, this seems the most difficult part to understand
at a glance. Plus, there seems multiple ways to do this.
Maybe, inline?
static inline sock_true_1_in_n(u32 r, unsigned int n)
{
/* return (r < ~0U / n); */
/* return (r % n == 0); */
return ((u64)r * n >> 32) == 0;
}
prev parent reply other threads:[~2013-01-21 2:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 0:07 [PATCH 2/5 v2] soreuseport: TCP/IPv4 implementation Tom Herbert
2013-01-21 2:30 ` YOSHIFUJI Hideaki [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=50FCA841.8020109@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@markandruth.co.uk \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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).