[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63c63fab-12ed-8b15-e00e-dc54e5c144eb@gmail.com>
Date: Mon, 2 Apr 2018 10:33:27 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Vincent Bernat <vincent@...nat.im>,
Wensong Zhang <wensong@...ux-vs.org>,
Simon Horman <horms@...ge.net.au>,
Julian Anastasov <ja@....bg>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
lvs-devel@...r.kernel.org
Subject: Re: [PATCH net-next v1] ipvs: add consistent source hashing
scheduling
On 04/02/2018 10:20 AM, Vincent Bernat wrote:
> +static inline u32
> +ip_vs_csh_permutation(struct ip_vs_dest *d, int j)
> +{
> + u32 offset, skip;
> + __be32 addr_fold = d->addr.ip;
> +
> +#ifdef CONFIG_IP_VS_IPV6
> + if (d->af == AF_INET6)
> + addr_fold = d->addr.ip6[0]^d->addr.ip6[1]^
> + d->addr.ip6[2]^d->addr.ip6[3];
> +#endif
> + addr_fold = ntohl(addr_fold) + ntohs(d->port);
> + offset = hash_32(addr_fold, 32) % IP_VS_CSH_TAB_SIZE;
> + skip = (hash_32(addr_fold + 1, 32) % (IP_VS_CSH_TAB_SIZE - 1)) + 1;
> + return (offset + j * skip) % IP_VS_CSH_TAB_SIZE;
> +}
> +
This does not look very strong to me, particularly the IPv6 folding
I would rather use __ipv6_addr_jhash() instead of ipv6_addr_hash(), even if it is hard coded ;)
Powered by blists - more mailing lists