net: ethtool: add support for symmetric-xor RSS hash
authorAhmed Zaki <ahmed.zaki@intel.com>
Wed, 13 Dec 2023 00:33:16 +0000 (17:33 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Dec 2023 06:07:16 +0000 (22:07 -0800)
commit13e59344fb9d3c9d3acd138ae320b5b67b658694
tree3f7a839e6f1077c04088aa3cdafa18e659357821
parentdcd8dbf9e734eb334113ea43186c1c26e9f497bb
net: ethtool: add support for symmetric-xor RSS hash

Symmetric RSS hash functions are beneficial in applications that monitor
both Tx and Rx packets of the same flow (IDS, software firewalls, ..etc).
Getting all traffic of the same flow on the same RX queue results in
higher CPU cache efficiency.

A NIC that supports "symmetric-xor" can achieve this RSS hash symmetry
by XORing the source and destination fields and pass the values to the
RSS hash algorithm.

The user may request RSS hash symmetry for a specific algorithm, via:

    # ethtool -X eth0 hfunc <hash_alg> symmetric-xor

or turn symmetry off (asymmetric) by:

    # ethtool -X eth0 hfunc <hash_alg>

The specific fields for each flow type should then be specified as usual
via:
    # ethtool -N|-U eth0 rx-flow-hash <flow_type> s|d|f|n

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Link: https://lore.kernel.org/r/20231213003321.605376-4-ahmed.zaki@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/specs/ethtool.yaml
Documentation/networking/ethtool-netlink.rst
Documentation/networking/scaling.rst
include/linux/ethtool.h
include/uapi/linux/ethtool.h
include/uapi/linux/ethtool_netlink.h
net/ethtool/ioctl.c
net/ethtool/rss.c