diff options
author | Vlad Zolotarov <vladz@cloudius-systems.com> | 2015-03-30 14:35:29 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-04-11 14:50:28 -0400 |
commit | b641173915ae7b51c79abfde9580c3a381876bb1 (patch) | |
tree | 804ab6101fe91b4f6bcba1f6c7a2380f29a34126 /drivers/net/ethernet/intel/ixgbevf | |
parent | ad1431e2db5590bcc32ded8a27b3b5c0ced9add7 (diff) |
ixgbevf: Add the appropriate ethtool ops to query RSS indirection table and key
Added get_rxfh_indir_size, get_rxfh_key_size and get_rxfh ethtool_ops
callbacks implementations.
This enables the ethtool's "-x" and "--show-rxfh[-indir]" options for VF
devices.
This patch adds the support for 82599 and x540 devices only. Support for
other devices will be added later.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ethtool.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c index e83c85bf2602..b2f5b161d792 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c +++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c | |||
@@ -794,6 +794,71 @@ static int ixgbevf_set_coalesce(struct net_device *netdev, | |||
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | static int ixgbevf_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, | ||
798 | u32 *rules __always_unused) | ||
799 | { | ||
800 | struct ixgbevf_adapter *adapter = netdev_priv(dev); | ||
801 | |||
802 | switch (info->cmd) { | ||
803 | case ETHTOOL_GRXRINGS: | ||
804 | info->data = adapter->num_rx_queues; | ||
805 | return 0; | ||
806 | default: | ||
807 | hw_dbg(&adapter->hw, "Command parameters not supported\n"); | ||
808 | return -EOPNOTSUPP; | ||
809 | } | ||
810 | } | ||
811 | |||
812 | static u32 ixgbevf_get_rxfh_indir_size(struct net_device *netdev) | ||
813 | { | ||
814 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | ||
815 | |||
816 | /* We support this operation only for 82599 and x540 at the moment */ | ||
817 | if (adapter->hw.mac.type < ixgbe_mac_X550_vf) | ||
818 | return IXGBEVF_82599_RETA_SIZE; | ||
819 | |||
820 | return 0; | ||
821 | } | ||
822 | |||
823 | static u32 ixgbevf_get_rxfh_key_size(struct net_device *netdev) | ||
824 | { | ||
825 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | ||
826 | |||
827 | /* We support this operation only for 82599 and x540 at the moment */ | ||
828 | if (adapter->hw.mac.type < ixgbe_mac_X550_vf) | ||
829 | return IXGBEVF_RSS_HASH_KEY_SIZE; | ||
830 | |||
831 | return 0; | ||
832 | } | ||
833 | |||
834 | static int ixgbevf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, | ||
835 | u8 *hfunc) | ||
836 | { | ||
837 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | ||
838 | int err = 0; | ||
839 | |||
840 | if (hfunc) | ||
841 | *hfunc = ETH_RSS_HASH_TOP; | ||
842 | |||
843 | /* If neither indirection table nor hash key was requested - just | ||
844 | * return a success avoiding taking any locks. | ||
845 | */ | ||
846 | if (!indir && !key) | ||
847 | return 0; | ||
848 | |||
849 | spin_lock_bh(&adapter->mbx_lock); | ||
850 | if (indir) | ||
851 | err = ixgbevf_get_reta_locked(&adapter->hw, indir, | ||
852 | adapter->num_rx_queues); | ||
853 | |||
854 | if (!err && key) | ||
855 | err = ixgbevf_get_rss_key_locked(&adapter->hw, key); | ||
856 | |||
857 | spin_unlock_bh(&adapter->mbx_lock); | ||
858 | |||
859 | return err; | ||
860 | } | ||
861 | |||
797 | static const struct ethtool_ops ixgbevf_ethtool_ops = { | 862 | static const struct ethtool_ops ixgbevf_ethtool_ops = { |
798 | .get_settings = ixgbevf_get_settings, | 863 | .get_settings = ixgbevf_get_settings, |
799 | .get_drvinfo = ixgbevf_get_drvinfo, | 864 | .get_drvinfo = ixgbevf_get_drvinfo, |
@@ -811,6 +876,10 @@ static const struct ethtool_ops ixgbevf_ethtool_ops = { | |||
811 | .get_ethtool_stats = ixgbevf_get_ethtool_stats, | 876 | .get_ethtool_stats = ixgbevf_get_ethtool_stats, |
812 | .get_coalesce = ixgbevf_get_coalesce, | 877 | .get_coalesce = ixgbevf_get_coalesce, |
813 | .set_coalesce = ixgbevf_set_coalesce, | 878 | .set_coalesce = ixgbevf_set_coalesce, |
879 | .get_rxnfc = ixgbevf_get_rxnfc, | ||
880 | .get_rxfh_indir_size = ixgbevf_get_rxfh_indir_size, | ||
881 | .get_rxfh_key_size = ixgbevf_get_rxfh_key_size, | ||
882 | .get_rxfh = ixgbevf_get_rxfh, | ||
814 | }; | 883 | }; |
815 | 884 | ||
816 | void ixgbevf_set_ethtool_ops(struct net_device *netdev) | 885 | void ixgbevf_set_ethtool_ops(struct net_device *netdev) |