diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2010-04-27 19:22:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 19:22:42 -0400 |
commit | 87b6cf51acb4999fff7e6841986874b108679cb4 (patch) | |
tree | 304fe476f4d3acd192ba7991d28b888845114586 /drivers/net/cxgb4/cxgb4_main.c | |
parent | 8cd9b13207f9a38e4da2d69bba51eb8dcbe1ead9 (diff) |
cxgb4: set skb->rxhash
Implement the ->set_flags ethtool method to control NETIF_F_RXHASH and
set skb->rxhash to the HW calculated hash accordingly.
Follow Eric Dumazet's suggestion and use the hash value raw.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4/cxgb4_main.c')
-rw-r--r-- | drivers/net/cxgb4/cxgb4_main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c index 5f582dba928f..1bad50041427 100644 --- a/drivers/net/cxgb4/cxgb4_main.c +++ b/drivers/net/cxgb4/cxgb4_main.c | |||
@@ -1711,6 +1711,18 @@ static int set_tso(struct net_device *dev, u32 value) | |||
1711 | return 0; | 1711 | return 0; |
1712 | } | 1712 | } |
1713 | 1713 | ||
1714 | static int set_flags(struct net_device *dev, u32 flags) | ||
1715 | { | ||
1716 | if (flags & ~ETH_FLAG_RXHASH) | ||
1717 | return -EOPNOTSUPP; | ||
1718 | |||
1719 | if (flags & ETH_FLAG_RXHASH) | ||
1720 | dev->features |= NETIF_F_RXHASH; | ||
1721 | else | ||
1722 | dev->features &= ~NETIF_F_RXHASH; | ||
1723 | return 0; | ||
1724 | } | ||
1725 | |||
1714 | static struct ethtool_ops cxgb_ethtool_ops = { | 1726 | static struct ethtool_ops cxgb_ethtool_ops = { |
1715 | .get_settings = get_settings, | 1727 | .get_settings = get_settings, |
1716 | .set_settings = set_settings, | 1728 | .set_settings = set_settings, |
@@ -1741,6 +1753,7 @@ static struct ethtool_ops cxgb_ethtool_ops = { | |||
1741 | .get_wol = get_wol, | 1753 | .get_wol = get_wol, |
1742 | .set_wol = set_wol, | 1754 | .set_wol = set_wol, |
1743 | .set_tso = set_tso, | 1755 | .set_tso = set_tso, |
1756 | .set_flags = set_flags, | ||
1744 | .flash_device = set_flash, | 1757 | .flash_device = set_flash, |
1745 | }; | 1758 | }; |
1746 | 1759 | ||
@@ -3203,7 +3216,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3203 | 3216 | ||
3204 | netdev->features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6; | 3217 | netdev->features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6; |
3205 | netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 3218 | netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
3206 | netdev->features |= NETIF_F_GRO | highdma; | 3219 | netdev->features |= NETIF_F_GRO | NETIF_F_RXHASH | highdma; |
3207 | netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 3220 | netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
3208 | netdev->vlan_features = netdev->features & VLAN_FEAT; | 3221 | netdev->vlan_features = netdev->features & VLAN_FEAT; |
3209 | 3222 | ||