On Mon, Nov 14, 2016 at 11:07:53AM +0000, Amrani, Ram wrote: > Hi Leon, All, > While inspecting MLX code as well as other vendors' I see that the actual number of cq->cqe is configured to be less by 1 than 'entries'. Why is that? There is addition of 1 in mlx4_ib_create_cq(): 192 entries = roundup_pow_of_two(entries + 1); 193 cq->ibcq.cqe = entries - 1; The same goes for mlx4_alloc_resize_buf, just earlier in the stack. > > e.g. > struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, > const struct ib_cq_init_attr *attr, > struct ib_ucontext *context, > struct ib_udata *udata) > { > ... > cq->ibcq.cqe = entries - 1; > ... > } > > > static int mlx4_alloc_resize_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq *cq, > int entries) > { > ... > cq->resize_buf->cqe = entries - 1; // this is later copied to cq->ibcq.cqe > ... > } > > Thanks, > Ram >