diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2011-04-23 00:50:40 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-05-07 06:14:22 -0400 |
commit | 67a74ee2a24957012661dc4400e4f8e363d25fbb (patch) | |
tree | a97dd99b4a550755b2d6aee0816fc116a463bf5e /drivers/net/ixgbe | |
parent | 936db3559fc4f6d2892234cadcbd88b8a7d34898 (diff) |
ixgbe: add rxhash support
feed RSS hash into skb->rxhash
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 7 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 14 |
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index f2efa3245352..545b231b2a74 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -2253,8 +2253,13 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
2253 | need_reset = (data & ETH_FLAG_RXVLAN) != | 2253 | need_reset = (data & ETH_FLAG_RXVLAN) != |
2254 | (netdev->features & NETIF_F_HW_VLAN_RX); | 2254 | (netdev->features & NETIF_F_HW_VLAN_RX); |
2255 | 2255 | ||
2256 | if ((data & ETH_FLAG_RXHASH) && | ||
2257 | !(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) | ||
2258 | return -EOPNOTSUPP; | ||
2259 | |||
2256 | rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE | | 2260 | rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE | |
2257 | ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN); | 2261 | ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN | |
2262 | ETH_FLAG_RXHASH); | ||
2258 | if (rc) | 2263 | if (rc) |
2259 | return rc; | 2264 | return rc; |
2260 | 2265 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index eebb1921c660..56cc9a10c717 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1063,8 +1063,14 @@ static int __ixgbe_notify_dca(struct device *dev, void *data) | |||
1063 | 1063 | ||
1064 | return 0; | 1064 | return 0; |
1065 | } | 1065 | } |
1066 | |||
1067 | #endif /* CONFIG_IXGBE_DCA */ | 1066 | #endif /* CONFIG_IXGBE_DCA */ |
1067 | |||
1068 | static inline void ixgbe_rx_hash(union ixgbe_adv_rx_desc *rx_desc, | ||
1069 | struct sk_buff *skb) | ||
1070 | { | ||
1071 | skb->rxhash = le32_to_cpu(rx_desc->wb.lower.hi_dword.rss); | ||
1072 | } | ||
1073 | |||
1068 | /** | 1074 | /** |
1069 | * ixgbe_receive_skb - Send a completed packet up the stack | 1075 | * ixgbe_receive_skb - Send a completed packet up the stack |
1070 | * @adapter: board private structure | 1076 | * @adapter: board private structure |
@@ -1456,6 +1462,8 @@ static void ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1456 | } | 1462 | } |
1457 | 1463 | ||
1458 | ixgbe_rx_checksum(adapter, rx_desc, skb); | 1464 | ixgbe_rx_checksum(adapter, rx_desc, skb); |
1465 | if (adapter->netdev->features & NETIF_F_RXHASH) | ||
1466 | ixgbe_rx_hash(rx_desc, skb); | ||
1459 | 1467 | ||
1460 | /* probably a little skewed due to removing CRC */ | 1468 | /* probably a little skewed due to removing CRC */ |
1461 | total_rx_bytes += skb->len; | 1469 | total_rx_bytes += skb->len; |
@@ -7361,6 +7369,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
7361 | netdev->features |= NETIF_F_TSO; | 7369 | netdev->features |= NETIF_F_TSO; |
7362 | netdev->features |= NETIF_F_TSO6; | 7370 | netdev->features |= NETIF_F_TSO6; |
7363 | netdev->features |= NETIF_F_GRO; | 7371 | netdev->features |= NETIF_F_GRO; |
7372 | netdev->features |= NETIF_F_RXHASH; | ||
7364 | 7373 | ||
7365 | switch (adapter->hw.mac.type) { | 7374 | switch (adapter->hw.mac.type) { |
7366 | case ixgbe_mac_82599EB: | 7375 | case ixgbe_mac_82599EB: |
@@ -7441,6 +7450,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
7441 | if (err) | 7450 | if (err) |
7442 | goto err_sw_init; | 7451 | goto err_sw_init; |
7443 | 7452 | ||
7453 | if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) | ||
7454 | netdev->features &= ~NETIF_F_RXHASH; | ||
7455 | |||
7444 | switch (pdev->device) { | 7456 | switch (pdev->device) { |
7445 | case IXGBE_DEV_ID_82599_SFP: | 7457 | case IXGBE_DEV_ID_82599_SFP: |
7446 | /* Only this subdevice supports WOL */ | 7458 | /* Only this subdevice supports WOL */ |