Message ID | 20100506074940.GA23576@mtldesk030.lab.mtl.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c index 21786ad..07c0779 100644 --- a/drivers/net/mlx4/en_cq.c +++ b/drivers/net/mlx4/en_cq.c @@ -49,11 +49,12 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, { struct mlx4_en_dev *mdev = priv->mdev; int err; + int num_active_vectors = min_t(int, num_online_cpus(), mdev->dev->caps.num_comp_vectors); cq->size = entries; if (mode == RX) { cq->buf_size = cq->size * sizeof(struct mlx4_cqe); - cq->vector = ring % mdev->dev->caps.num_comp_vectors; + cq->vector = ring % num_active_vectors; } else { cq->buf_size = sizeof(struct mlx4_cqe); cq->vector = 0;