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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Index of Archives]     [Linux Filesystem Devel]     [Linux NFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [X.Org]

  Powered by Linux