Skip to content

Commit

Permalink
mlx4: Fixing bad size of event queue buffer
Browse files Browse the repository at this point in the history
We should reduce the number of reserved completion queues from the total
number of entries. Since the queue size is power of two, not reducing the
reserved entries, caused a double queue size, which may lead to allocation
failures in some cases.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yevgeny Petrilin authored and David S. Miller committed Mar 31, 2011
1 parent 5302009 commit c379474
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/mlx4/eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
}

for (i = 0; i < dev->caps.num_comp_vectors; ++i) {
err = mlx4_create_eq(dev, dev->caps.num_cqs + MLX4_NUM_SPARE_EQE,
err = mlx4_create_eq(dev, dev->caps.num_cqs -
dev->caps.reserved_cqs +
MLX4_NUM_SPARE_EQE,
(dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
&priv->eq_table.eq[i]);
if (err) {
Expand Down

0 comments on commit c379474

Please sign in to comment.