diff options
author | Eyal Perry <eyalpe@mellanox.com> | 2014-12-02 11:12:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 21:07:10 -0500 |
commit | 947cbb0ac242096d60380952ec1a1761372cba66 (patch) | |
tree | d22d19869b349a9abfc8f52dbbb9ae4c531ff7c6 /drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |
parent | 892311f66f2411b813ca631009356891a0c2b0a1 (diff) |
net/mlx4_en: Support for configurable RSS hash function
The ConnectX HW is capable of using one of the following hash functions:
Toeplitz and an XOR hash function. This patch extends the implementation
of the mlx4_en driver set/get_rxfh callbacks to support getting and
setting the RSS hash function used by the device.
Signed-off-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_netdev.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 1597fb07576c..dccf0e1f86be 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -2608,6 +2608,17 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2608 | if (mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_A0) | 2608 | if (mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_A0) |
2609 | dev->priv_flags |= IFF_UNICAST_FLT; | 2609 | dev->priv_flags |= IFF_UNICAST_FLT; |
2610 | 2610 | ||
2611 | /* Setting a default hash function value */ | ||
2612 | if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RSS_TOP) { | ||
2613 | priv->rss_hash_fn = ETH_RSS_HASH_TOP; | ||
2614 | } else if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RSS_XOR) { | ||
2615 | priv->rss_hash_fn = ETH_RSS_HASH_XOR; | ||
2616 | } else { | ||
2617 | en_warn(priv, | ||
2618 | "No RSS hash capabilities exposed, using Toeplitz\n"); | ||
2619 | priv->rss_hash_fn = ETH_RSS_HASH_TOP; | ||
2620 | } | ||
2621 | |||
2611 | mdev->pndev[port] = dev; | 2622 | mdev->pndev[port] = dev; |
2612 | 2623 | ||
2613 | netif_carrier_off(dev); | 2624 | netif_carrier_off(dev); |