aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorEyal Perry <eyalpe@mellanox.com>2014-12-02 11:12:10 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-08 21:07:10 -0500
commit892311f66f2411b813ca631009356891a0c2b0a1 (patch)
tree42267098964290cf349abd6733267c24867f2318 /include/uapi/linux
parent18b5427ae1654803930b97590ac5a85245861646 (diff)
ethtool: Support for configurable RSS hash function
This patch extends the set/get_rxfh ethtool-options for getting or setting the RSS hash function. It modifies drivers implementation of set/get_rxfh accordingly. This change also delegates the responsibility of checking whether a modification to a certain RX flow hash parameter is supported to the driver implementation of set_rxfh. User-kernel API is done through the new hfunc bitmask field in the ethtool_rxfh struct. A bit set in the hfunc field is corresponding to an index in the new string-set ETH_SS_RSS_HASH_FUNCS. Got approval from most of the relevant driver maintainers that their driver is using Toeplitz, and for the few that didn't answered, also assumed it is Toeplitz. Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Ariel Elior <ariel.elior@qlogic.com> Cc: Prashant Sreedharan <prashant@broadcom.com> Cc: Michael Chan <mchan@broadcom.com> Cc: Hariprasad S <hariprasad@chelsio.com> Cc: Sathya Perla <sathya.perla@emulex.com> Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com> Cc: Ajit Khaparde <ajit.khaparde@emulex.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: Bruce Allan <bruce.w.allan@intel.com> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com> Cc: Don Skidmore <donald.c.skidmore@intel.com> Cc: Greg Rose <gregory.v.rose@intel.com> Cc: Matthew Vick <matthew.vick@intel.com> Cc: John Ronciak <john.ronciak@intel.com> Cc: Mitch Williams <mitch.a.williams@intel.com> Cc: Amir Vadai <amirv@mellanox.com> Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com> Cc: Shradha Shah <sshah@solarflare.com> Cc: Shreyas Bhatewara <sbhatewara@vmware.com> Cc: "VMware, Inc." <pv-drivers@vmware.com> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Eyal Perry <eyalpe@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/ethtool.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index eb2095b42fbb..5f66d9c2889d 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -534,6 +534,7 @@ struct ethtool_pauseparam {
534 * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE; 534 * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE;
535 * now deprecated 535 * now deprecated
536 * @ETH_SS_FEATURES: Device feature names 536 * @ETH_SS_FEATURES: Device feature names
537 * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
537 */ 538 */
538enum ethtool_stringset { 539enum ethtool_stringset {
539 ETH_SS_TEST = 0, 540 ETH_SS_TEST = 0,
@@ -541,6 +542,7 @@ enum ethtool_stringset {
541 ETH_SS_PRIV_FLAGS, 542 ETH_SS_PRIV_FLAGS,
542 ETH_SS_NTUPLE_FILTERS, 543 ETH_SS_NTUPLE_FILTERS,
543 ETH_SS_FEATURES, 544 ETH_SS_FEATURES,
545 ETH_SS_RSS_HASH_FUNCS,
544}; 546};
545 547
546/** 548/**
@@ -884,6 +886,8 @@ struct ethtool_rxfh_indir {
884 * @key_size: On entry, the array size of the user buffer for the hash key, 886 * @key_size: On entry, the array size of the user buffer for the hash key,
885 * which may be zero. On return from %ETHTOOL_GRSSH, the size of the 887 * which may be zero. On return from %ETHTOOL_GRSSH, the size of the
886 * hardware hash key. 888 * hardware hash key.
889 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
890 * Valid values are one of the %ETH_RSS_HASH_*.
887 * @rsvd: Reserved for future extensions. 891 * @rsvd: Reserved for future extensions.
888 * @rss_config: RX ring/queue index for each hash value i.e., indirection table 892 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
889 * of @indir_size __u32 elements, followed by hash key of @key_size 893 * of @indir_size __u32 elements, followed by hash key of @key_size
@@ -893,14 +897,16 @@ struct ethtool_rxfh_indir {
893 * size should be returned. For %ETHTOOL_SRSSH, an @indir_size of 897 * size should be returned. For %ETHTOOL_SRSSH, an @indir_size of
894 * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested 898 * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
895 * and a @indir_size of zero means the indir table should be reset to default 899 * and a @indir_size of zero means the indir table should be reset to default
896 * values. 900 * values. An hfunc of zero means that hash function setting is not requested.
897 */ 901 */
898struct ethtool_rxfh { 902struct ethtool_rxfh {
899 __u32 cmd; 903 __u32 cmd;
900 __u32 rss_context; 904 __u32 rss_context;
901 __u32 indir_size; 905 __u32 indir_size;
902 __u32 key_size; 906 __u32 key_size;
903 __u32 rsvd[2]; 907 __u8 hfunc;
908 __u8 rsvd8[3];
909 __u32 rsvd32;
904 __u32 rss_config[0]; 910 __u32 rss_config[0];
905}; 911};
906#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff 912#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff