On 5/11/2020 11:39 AM, Sagi Grimberg wrote:
static void rdma_dim_init(struct ib_cq *cq)
@@ -218,6 +222,7 @@ struct ib_cq *__ib_alloc_cq_user(struct
ib_device *dev, void *private,
cq->cq_context = private;
cq->poll_ctx = poll_ctx;
atomic_set(&cq->usecnt, 0);
+ cq->cq_type = IB_CQ_PRIVATE;
I would say it should be opposite, default is not shared CQ and only
pool sets something specific to mark that it is shared.
Agree.
Will fix.
+int rdma_set_cq_moderation(struct ib_cq *cq, u16 cq_count, u16
cq_period)
+{
+ if (WARN_ON_ONCE(cq->cq_type != IB_CQ_PRIVATE))
+ return -EOPNOTSUPP;
+ else
+ return _rdma_set_cq_moderation(cq, cq_count, cq_period);
+}
EXPORT_SYMBOL(rdma_set_cq_moderation);
-int ib_destroy_cq_user(struct ib_cq *cq, struct ib_udata *udata)
+int rdma_set_cq_moderation_force(struct ib_cq *cq, u16 cq_count,
u16 cq_period)
+{
+ return _rdma_set_cq_moderation(cq, cq_count, cq_period);
+}
All these one liners makes no sense, the call to
_rdma_set_cq_moderation() in this function and above is exactly the
same. It means there is no need in specific function.
Agree as well.
I thought it was clearer this way but I understand your point, I will
fix it.