aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/ethtool.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2012-01-10 20:26:50 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-01-26 02:11:55 -0500
commit70495a500d787c0c90a136acf454cb7d0eecd82e (patch)
treeb84a478b2e33ed628043638b6bf2aff46c1c5720 /drivers/net/ethernet/intel/e1000e/ethtool.c
parentafd12939a09ca8f96cf8349c913dc143471c9b3c (diff)
e1000e: add Receive Packet Steering (RPS) support
Enable RPS by default. Disallow jumbo frames when both receive checksum and receive hashing are enabled because the hardware cannot do both IP payload checksum (enabled when receive checksum is enabled when using packet split which is used for jumbo frames) and provide RSS hash at the same time. v2: added ethtool command to query flow hashing behavior per Ben Hutchings and changed the type of rsskey to cleanup the setting of the register array and avoid unnecessary casts (as pointed out by Joe Perches). The long error messages are not changed since there is nothing in the kernel ./Documentation that suggests the preferred method for dealing with long messages other than to never break strings; leaving them as-is for now. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/ethtool.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index fb2c28e799a2..0a3137a791e9 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -1955,6 +1955,53 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset,
1955 } 1955 }
1956} 1956}
1957 1957
1958static int e1000_get_rxnfc(struct net_device *netdev,
1959 struct ethtool_rxnfc *info, u32 *rule_locs)
1960{
1961 info->data = 0;
1962
1963 switch (info->cmd) {
1964 case ETHTOOL_GRXFH: {
1965 struct e1000_adapter *adapter = netdev_priv(netdev);
1966 struct e1000_hw *hw = &adapter->hw;
1967 u32 mrqc = er32(MRQC);
1968
1969 if (!(mrqc & E1000_MRQC_RSS_FIELD_MASK))
1970 return 0;
1971
1972 switch (info->flow_type) {
1973 case TCP_V4_FLOW:
1974 if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP)
1975 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
1976 /* fall through */
1977 case UDP_V4_FLOW:
1978 case SCTP_V4_FLOW:
1979 case AH_ESP_V4_FLOW:
1980 case IPV4_FLOW:
1981 if (mrqc & E1000_MRQC_RSS_FIELD_IPV4)
1982 info->data |= RXH_IP_SRC | RXH_IP_DST;
1983 break;
1984 case TCP_V6_FLOW:
1985 if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP)
1986 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
1987 /* fall through */
1988 case UDP_V6_FLOW:
1989 case SCTP_V6_FLOW:
1990 case AH_ESP_V6_FLOW:
1991 case IPV6_FLOW:
1992 if (mrqc & E1000_MRQC_RSS_FIELD_IPV6)
1993 info->data |= RXH_IP_SRC | RXH_IP_DST;
1994 break;
1995 default:
1996 break;
1997 }
1998 return 0;
1999 }
2000 default:
2001 return -EOPNOTSUPP;
2002 }
2003}
2004
1958static const struct ethtool_ops e1000_ethtool_ops = { 2005static const struct ethtool_ops e1000_ethtool_ops = {
1959 .get_settings = e1000_get_settings, 2006 .get_settings = e1000_get_settings,
1960 .set_settings = e1000_set_settings, 2007 .set_settings = e1000_set_settings,
@@ -1981,6 +2028,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
1981 .get_sset_count = e1000e_get_sset_count, 2028 .get_sset_count = e1000e_get_sset_count,
1982 .get_coalesce = e1000_get_coalesce, 2029 .get_coalesce = e1000_get_coalesce,
1983 .set_coalesce = e1000_set_coalesce, 2030 .set_coalesce = e1000_set_coalesce,
2031 .get_rxnfc = e1000_get_rxnfc,
1984}; 2032};
1985 2033
1986void e1000e_set_ethtool_ops(struct net_device *netdev) 2034void e1000e_set_ethtool_ops(struct net_device *netdev)