diff options
author | Eyal Perry <eyalpe@mellanox.com> | 2014-12-02 11:12:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 21:07:10 -0500 |
commit | 892311f66f2411b813ca631009356891a0c2b0a1 (patch) | |
tree | 42267098964290cf349abd6733267c24867f2318 /drivers/net/ethernet/amd/xgbe | |
parent | 18b5427ae1654803930b97590ac5a85245861646 (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/amd/xgbe')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c index 95d44538357f..ebf489351555 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | |||
@@ -511,7 +511,8 @@ static u32 xgbe_get_rxfh_indir_size(struct net_device *netdev) | |||
511 | return ARRAY_SIZE(pdata->rss_table); | 511 | return ARRAY_SIZE(pdata->rss_table); |
512 | } | 512 | } |
513 | 513 | ||
514 | static int xgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key) | 514 | static int xgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, |
515 | u8 *hfunc) | ||
515 | { | 516 | { |
516 | struct xgbe_prv_data *pdata = netdev_priv(netdev); | 517 | struct xgbe_prv_data *pdata = netdev_priv(netdev); |
517 | unsigned int i; | 518 | unsigned int i; |
@@ -525,16 +526,22 @@ static int xgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key) | |||
525 | if (key) | 526 | if (key) |
526 | memcpy(key, pdata->rss_key, sizeof(pdata->rss_key)); | 527 | memcpy(key, pdata->rss_key, sizeof(pdata->rss_key)); |
527 | 528 | ||
529 | if (hfunc) | ||
530 | *hfunc = ETH_RSS_HASH_TOP; | ||
531 | |||
528 | return 0; | 532 | return 0; |
529 | } | 533 | } |
530 | 534 | ||
531 | static int xgbe_set_rxfh(struct net_device *netdev, const u32 *indir, | 535 | static int xgbe_set_rxfh(struct net_device *netdev, const u32 *indir, |
532 | const u8 *key) | 536 | const u8 *key, const u8 hfunc) |
533 | { | 537 | { |
534 | struct xgbe_prv_data *pdata = netdev_priv(netdev); | 538 | struct xgbe_prv_data *pdata = netdev_priv(netdev); |
535 | struct xgbe_hw_if *hw_if = &pdata->hw_if; | 539 | struct xgbe_hw_if *hw_if = &pdata->hw_if; |
536 | unsigned int ret; | 540 | unsigned int ret; |
537 | 541 | ||
542 | if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) | ||
543 | return -EOPNOTSUPP; | ||
544 | |||
538 | if (indir) { | 545 | if (indir) { |
539 | ret = hw_if->set_rss_lookup_table(pdata, indir); | 546 | ret = hw_if->set_rss_lookup_table(pdata, indir); |
540 | if (ret) | 547 | if (ret) |