Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Upgrade to 4.4.50-rt62
[kvmfornfv.git]
/
kernel
/
drivers
/
infiniband
/
hw
/
mlx5
/
cq.c
diff --git
a/kernel/drivers/infiniband/hw/mlx5/cq.c
b/kernel/drivers/infiniband/hw/mlx5/cq.c
index
92ddae1
..
02c8dea
100644
(file)
--- a/
kernel/drivers/infiniband/hw/mlx5/cq.c
+++ b/
kernel/drivers/infiniband/hw/mlx5/cq.c
@@
-763,7
+763,8
@@
struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
if (attr->flags)
return ERR_PTR(-EINVAL);
if (attr->flags)
return ERR_PTR(-EINVAL);
- if (entries < 0)
+ if (entries < 0 ||
+ (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz))))
return ERR_PTR(-EINVAL);
entries = roundup_pow_of_two(entries + 1);
return ERR_PTR(-EINVAL);
entries = roundup_pow_of_two(entries + 1);
@@
-786,8
+787,7
@@
struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
if (err)
goto err_create;
} else {
if (err)
goto err_create;
} else {
- /* for now choose 64 bytes till we have a proper interface */
- cqe_size = 64;
+ cqe_size = cache_line_size() == 128 ? 128 : 64;
err = create_cq_kernel(dev, cq, entries, cqe_size, &cqb,
&index, &inlen);
if (err)
err = create_cq_kernel(dev, cq, entries, cqe_size, &cqb,
&index, &inlen);
if (err)
@@
-1094,11
+1094,16
@@
int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
return -ENOSYS;
}
return -ENOSYS;
}
- if (entries < 1)
+ if (entries < 1 ||
+ entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz))) {
+ mlx5_ib_warn(dev, "wrong entries number %d, max %d\n",
+ entries,
+ 1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz));
return -EINVAL;
return -EINVAL;
+ }
entries = roundup_pow_of_two(entries + 1);
entries = roundup_pow_of_two(entries + 1);
- if (entries >
(1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)) + 1)
+ if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)) + 1)
return -EINVAL;
if (entries == ibcq->cqe + 1)
return -EINVAL;
if (entries == ibcq->cqe + 1)