aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-08-26 03:46:29 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-10-08 01:56:22 -0400
commit077887c386226e4def56898449c26bb15f523728 (patch)
tree931a98ae634b4c8b432a568bcbc67f27716db60f /drivers/net/ethernet
parent6d095fa8cb1bb87fe8bf956cdf6211e784b4c9e4 (diff)
igb: add support for NETIF_F_RXHASH
This patch adds support for Rx hashing. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 77ade67ddbdc..10670f944115 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1978,23 +1978,32 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1978 dev_info(&pdev->dev, 1978 dev_info(&pdev->dev,
1979 "PHY reset is blocked due to SOL/IDER session.\n"); 1979 "PHY reset is blocked due to SOL/IDER session.\n");
1980 1980
1981 netdev->hw_features = NETIF_F_SG | 1981 /*
1982 NETIF_F_IP_CSUM | 1982 * features is initialized to 0 in allocation, it might have bits
1983 NETIF_F_IPV6_CSUM | 1983 * set by igb_sw_init so we should use an or instead of an
1984 NETIF_F_TSO | 1984 * assignment.
1985 NETIF_F_TSO6 | 1985 */
1986 NETIF_F_RXCSUM | 1986 netdev->features |= NETIF_F_SG |
1987 NETIF_F_HW_VLAN_RX; 1987 NETIF_F_IP_CSUM |
1988 1988 NETIF_F_IPV6_CSUM |
1989 netdev->features = netdev->hw_features | 1989 NETIF_F_TSO |
1990 NETIF_F_HW_VLAN_TX | 1990 NETIF_F_TSO6 |
1991 NETIF_F_HW_VLAN_FILTER; 1991 NETIF_F_RXHASH |
1992 1992 NETIF_F_RXCSUM |
1993 netdev->vlan_features |= NETIF_F_TSO; 1993 NETIF_F_HW_VLAN_RX |
1994 netdev->vlan_features |= NETIF_F_TSO6; 1994 NETIF_F_HW_VLAN_TX;
1995 netdev->vlan_features |= NETIF_F_IP_CSUM; 1995
1996 netdev->vlan_features |= NETIF_F_IPV6_CSUM; 1996 /* copy netdev features into list of user selectable features */
1997 netdev->vlan_features |= NETIF_F_SG; 1997 netdev->hw_features |= netdev->features;
1998
1999 /* set this bit last since it cannot be part of hw_features */
2000 netdev->features |= NETIF_F_HW_VLAN_FILTER;
2001
2002 netdev->vlan_features |= NETIF_F_TSO |
2003 NETIF_F_TSO6 |
2004 NETIF_F_IP_CSUM |
2005 NETIF_F_IPV6_CSUM |
2006 NETIF_F_SG;
1998 2007
1999 if (pci_using_dac) { 2008 if (pci_using_dac) {
2000 netdev->features |= NETIF_F_HIGHDMA; 2009 netdev->features |= NETIF_F_HIGHDMA;
@@ -5827,6 +5836,14 @@ static inline void igb_rx_checksum(struct igb_ring *ring,
5827 le32_to_cpu(rx_desc->wb.upper.status_error)); 5836 le32_to_cpu(rx_desc->wb.upper.status_error));
5828} 5837}
5829 5838
5839static inline void igb_rx_hash(struct igb_ring *ring,
5840 union e1000_adv_rx_desc *rx_desc,
5841 struct sk_buff *skb)
5842{
5843 if (ring->netdev->features & NETIF_F_RXHASH)
5844 skb->rxhash = le32_to_cpu(rx_desc->wb.lower.hi_dword.rss);
5845}
5846
5830static void igb_rx_hwtstamp(struct igb_q_vector *q_vector, 5847static void igb_rx_hwtstamp(struct igb_q_vector *q_vector,
5831 union e1000_adv_rx_desc *rx_desc, 5848 union e1000_adv_rx_desc *rx_desc,
5832 struct sk_buff *skb) 5849 struct sk_buff *skb)
@@ -5959,6 +5976,7 @@ static bool igb_clean_rx_irq(struct igb_q_vector *q_vector, int budget)
5959 } 5976 }
5960 5977
5961 igb_rx_hwtstamp(q_vector, rx_desc, skb); 5978 igb_rx_hwtstamp(q_vector, rx_desc, skb);
5979 igb_rx_hash(rx_ring, rx_desc, skb);
5962 igb_rx_checksum(rx_ring, rx_desc, skb); 5980 igb_rx_checksum(rx_ring, rx_desc, skb);
5963 5981
5964 if (igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) { 5982 if (igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) {