RSS Hash Function

The device has the ability to use XOR as the RSS distribution function, instead of the default Toplitz function.
The XOR function can be better distributed among driver's receive queues in a small number of streams, where it distributes each TCP/UDP stream to a different queue.

MLNX_EN provides one of the following options to change the working RSS hash function from Toplitz to XOR, and vice versa:

  • Through ethtool priv-flags, in case mlx4_rss_xor_hash_function is not part of the priv-flags list.

    Copy
    Copied!
                

    ethtool --set-priv-flags eth<x> mlx4_rss_xor_hash_function on/off

  • Through ethtool, provided as part of MLNX_EN package, in case mlx4_rss_x- or_hash_function is not part of the priv-flags list:

    Copy
    Copied!
                

    /opt/mellanox/ethtool# ./sbin/ethtool -X ens4 hfunc xor /opt/mellanox/ethtool# ./sbin/ethtool --show-rxfh ens4

    Output:

    Copy
    Copied!
                

    RX flow hash indirection table for ens4 with 8 RX ring(s): 0: 0 1 2 3 4 5 6 7 RSS hash key: 7c:9c:37:de:18:dc:43:86:d9:27:0f:6f:26:03:74:b8:bf:d0:40:4b:78:72:e2:24:dc:1b:91:bb:01:1b:a7:a6:37:6c:c8:7e:d6:e3:14:17 RSS hash function: toeplitz: off xor : on

For further information, please refer to E thtoolSupportedOptions table.

MLNX_EN provides the following option to change the working RSS hash function from Toplitz to XOR, and vice versa:

Through sysfs, located at: /sys/class/net/eth*/settings/hfunc.

To query the operational and supported hash functions:

Copy
Copied!
            

cat /sys/class/net/eth*/settings/hfunc

Example:

Copy
Copied!
            

cat /sys/class/net/eth2/settings/hfunc Operational hfunc: toeplitz Supported hfuncs: xor toeplitz

To change the operational hash function:

Copy
Copied!
            

echo xor > /sys/class/net/eth*/settings/hfunc

Warning

Supported in ConnectX-3 and ConnectX-3 Pro only.

As of MLNX_EN v2.4-.1.0.0, RSS will distribute incoming IP fragmented datagrams according to its hash function, considering the L3 IP header values. Different IP fragmented datagram flows will be directed to different rings.

Warning

When the first packet in IP fragments chain contains upper layer transport header (e.g. UDP packets larger than MTU), it will be directed to the same target as the proceeding IP fragments that follow it, to prevent out-of-order processing.

© Copyright 2023, NVIDIA. Last updated on May 23, 2023.