Return failure if asked to resize CQ to fewer than outstanding entries
From: Roland Dreier <[email protected]>
Don't silently return 0 (success) but not resize the CQ when the number of outstanding entries is smaller than the size requested. Instead return EINVAL so the consumer knows the CQ wasn't resized.
This is one of the fixes in kernel commit 8ab9406a41c8 ("IB/mlx4: Bug fixes in mlx4_ib_resize_cq") from Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>.
--- src/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/verbs.c +1 -1
@@ -392,7 +392,7 @@ int mlx4_resize_cq(struct ibv_cq *ibcq, int cqe)/* Can't be smaller then the number of outstanding CQEs */ outst_cqe =mlx4_get_outstanding_cqes (cq);if (cqe < outst_cqe +1 ) { - ret =0 ; + ret =EINVAL ; goto out; }
Signature · 6 lines
2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 19 lines · Roland Dreier
From: Roland Dreier <[email protected]>
Don't silently return 0 (success) but not resize the CQ when the number of outstanding entries is smaller than the size requested. Instead return EINVAL so the consumer knows the CQ wasn't resized.
This is one of the fixes in kernel commit
8ab9406a41c8("IB/mlx4: Bug fixes inmlx4_ib_resize_cq") from Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>.Signed-off-by Roland Dreier <[email protected]>--- src/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/verbs.c +0
-0
src/verbs.c int mlx4_resize_cq(struct ibv_cq *ibcq, int cqe) · line 398
Quoted 8 lines
src/verbs.c +1
-1@@ -392,7 +392,7 @@ int mlx4_resize_cq(struct ibv_cq *ibcq, int cqe)/* Can't be smaller then the number of outstanding CQEs */ outst_cqe =mlx4_get_outstanding_cqes (cq);if (cqe < outst_cqe +1 ) { - ret =0 ; + ret =EINVAL ; goto out; }
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html