aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/fm10k
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 /drivers/net/ethernet/intel/fm10k
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 'drivers/net/ethernet/intel/fm10k')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index 2d04464e6aa3..651f53bc7376 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -916,11 +916,15 @@ static u32 fm10k_get_rssrk_size(struct net_device *netdev)
916 return FM10K_RSSRK_SIZE * FM10K_RSSRK_ENTRIES_PER_REG; 916 return FM10K_RSSRK_SIZE * FM10K_RSSRK_ENTRIES_PER_REG;
917} 917}
918 918
919static int fm10k_get_rssh(struct net_device *netdev, u32 *indir, u8 *key) 919static int fm10k_get_rssh(struct net_device *netdev, u32 *indir, u8 *key,
920 u8 *hfunc)
920{ 921{
921 struct fm10k_intfc *interface = netdev_priv(netdev); 922 struct fm10k_intfc *interface = netdev_priv(netdev);
922 int i, err; 923 int i, err;
923 924
925 if (hfunc)
926 *hfunc = ETH_RSS_HASH_TOP;
927
924 err = fm10k_get_reta(netdev, indir); 928 err = fm10k_get_reta(netdev, indir);
925 if (err || !key) 929 if (err || !key)
926 return err; 930 return err;
@@ -932,12 +936,16 @@ static int fm10k_get_rssh(struct net_device *netdev, u32 *indir, u8 *key)
932} 936}
933 937
934static int fm10k_set_rssh(struct net_device *netdev, const u32 *indir, 938static int fm10k_set_rssh(struct net_device *netdev, const u32 *indir,
935 const u8 *key) 939 const u8 *key, const u8 hfunc)
936{ 940{
937 struct fm10k_intfc *interface = netdev_priv(netdev); 941 struct fm10k_intfc *interface = netdev_priv(netdev);
938 struct fm10k_hw *hw = &interface->hw; 942 struct fm10k_hw *hw = &interface->hw;
939 int i, err; 943 int i, err;
940 944
945 /* We do not allow change in unsupported parameters */
946 if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
947 return -EOPNOTSUPP;
948
941 err = fm10k_set_reta(netdev, indir); 949 err = fm10k_set_reta(netdev, indir);
942 if (err || !key) 950 if (err || !key)
943 return err; 951 return err;