summaryrefslogtreecommitdiff
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorAhmed Zaki <ahmed.zaki@intel.com>2023-12-13 03:33:16 +0300
committerJakub Kicinski <kuba@kernel.org>2023-12-14 09:07:16 +0300
commit13e59344fb9d3c9d3acd138ae320b5b67b658694 (patch)
tree3f7a839e6f1077c04088aa3cdafa18e659357821 /include/linux/ethtool.h
parentdcd8dbf9e734eb334113ea43186c1c26e9f497bb (diff)
downloadlinux-13e59344fb9d3c9d3acd138ae320b5b67b658694.tar.xz
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>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 66fe254c3e51..cfcd952a1d4f 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -615,6 +615,8 @@ struct ethtool_mm_stats {
* to allocate a new RSS context; on return this field will
* contain the ID of the newly allocated context.
* @rss_delete: Set to non-ZERO to remove the @rss_context context.
+ * @input_xfrm: Defines how the input data is transformed. Valid values are one
+ * of %RXH_XFRM_*.
*/
struct ethtool_rxfh_param {
u8 hfunc;
@@ -624,6 +626,7 @@ struct ethtool_rxfh_param {
u8 *key;
u32 rss_context;
u8 rss_delete;
+ u8 input_xfrm;
};
/**
@@ -632,6 +635,8 @@ struct ethtool_rxfh_param {
* parameter.
* @cap_rss_ctx_supported: indicates if the driver supports RSS
* contexts.
+ * @cap_rss_sym_xor_supported: indicates if the driver supports symmetric-xor
+ * RSS.
* @supported_coalesce_params: supported types of interrupt coalescing.
* @supported_ring_params: supported ring params.
* @get_drvinfo: Report driver/device information. Modern drivers no
@@ -811,6 +816,7 @@ struct ethtool_rxfh_param {
struct ethtool_ops {
u32 cap_link_lanes_supported:1;
u32 cap_rss_ctx_supported:1;
+ u32 cap_rss_sym_xor_supported:1;
u32 supported_coalesce_params;
u32 supported_ring_params;
void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);