diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_rx.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_rx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index e8d6ad2dce0a..971d4b6b8dfe 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -853,6 +853,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) | |||
853 | struct mlx4_en_rss_map *rss_map = &priv->rss_map; | 853 | struct mlx4_en_rss_map *rss_map = &priv->rss_map; |
854 | struct mlx4_qp_context context; | 854 | struct mlx4_qp_context context; |
855 | struct mlx4_rss_context *rss_context; | 855 | struct mlx4_rss_context *rss_context; |
856 | int rss_rings; | ||
856 | void *ptr; | 857 | void *ptr; |
857 | u8 rss_mask = (MLX4_RSS_IPV4 | MLX4_RSS_TCP_IPV4 | MLX4_RSS_IPV6 | | 858 | u8 rss_mask = (MLX4_RSS_IPV4 | MLX4_RSS_TCP_IPV4 | MLX4_RSS_IPV6 | |
858 | MLX4_RSS_TCP_IPV6); | 859 | MLX4_RSS_TCP_IPV6); |
@@ -893,10 +894,15 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) | |||
893 | mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn, | 894 | mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn, |
894 | priv->rx_ring[0].cqn, &context); | 895 | priv->rx_ring[0].cqn, &context); |
895 | 896 | ||
897 | if (!priv->prof->rss_rings || priv->prof->rss_rings > priv->rx_ring_num) | ||
898 | rss_rings = priv->rx_ring_num; | ||
899 | else | ||
900 | rss_rings = priv->prof->rss_rings; | ||
901 | |||
896 | ptr = ((void *) &context) + offsetof(struct mlx4_qp_context, pri_path) | 902 | ptr = ((void *) &context) + offsetof(struct mlx4_qp_context, pri_path) |
897 | + MLX4_RSS_OFFSET_IN_QPC_PRI_PATH; | 903 | + MLX4_RSS_OFFSET_IN_QPC_PRI_PATH; |
898 | rss_context = ptr; | 904 | rss_context = ptr; |
899 | rss_context->base_qpn = cpu_to_be32(ilog2(priv->rx_ring_num) << 24 | | 905 | rss_context->base_qpn = cpu_to_be32(ilog2(rss_rings) << 24 | |
900 | (rss_map->base_qpn)); | 906 | (rss_map->base_qpn)); |
901 | rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn); | 907 | rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn); |
902 | if (priv->mdev->profile.udp_rss) { | 908 | if (priv->mdev->profile.udp_rss) { |