LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH net-next v1] ipvs: add consistent source hashing scheduling

To: Vincent Bernat <vincent@xxxxxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH net-next v1] ipvs: add consistent source hashing scheduling
From: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Date: Mon, 2 Apr 2018 10:33:27 -0700

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 ;)



--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>