mlxsw: spectrum_router: Align multipath hash parameters with kernel's
authorIdo Schimmel <idosch@mellanox.com>
Thu, 2 Nov 2017 16:14:09 +0000 (17:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Nov 2017 06:40:41 +0000 (15:40 +0900)
commitaf658b6a0e6da7a9d9b82fa536d610a7457f37fd
treece6ab6afb83fd9332eec13924fe332d75adae0f2
parente471859b72fc2d9fe0f3163a7c238029271259ec
mlxsw: spectrum_router: Align multipath hash parameters with kernel's

Up until now we used the hardware's defaults for multipath hash
computation. This patch aligns the hardware's multipath parameters with
the kernel's.

For IPv4 packets, the parameters are determined according to the
'fib_multipath_hash_policy' sysctl during module initialization. In case
L3-mode is requested, only the source and destination IP addresses are
used. There is no special handling of ICMP error packets.

In case L4-mode is requested, a 5-tuple is used: source and destination
IP addresses, source and destination ports and IP protocol. Note that
the layer 4 fields are not considered for fragmented packets.

For IPv6 packets, the source and destination IP addresses are used, as
well as the flow label and the next header fields.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c