[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50FCA841.8020109@linux-ipv6.org>
Date: Mon, 21 Jan 2013 11:30:25 +0900
From: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
To: Tom Herbert <therbert@...gle.com>
CC: netdev@...r.kernel.org, davem@...emloft.net,
netdev@...kandruth.co.uk, eric.dumazet@...il.com
Subject: Re: [PATCH 2/5 v2] soreuseport: TCP/IPv4 implementation
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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists