public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* Configuration of cq->cqe is lower than entries by 1
@ 2016-11-14 11:07 Amrani, Ram
       [not found] ` <SN1PR07MB22076C5DE03F1939603C554CF8BC0-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Amrani, Ram @ 2016-11-14 11:07 UTC (permalink / raw)
  To: Leon Romanovsky,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

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?

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

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-16 10:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 11:07 Configuration of cq->cqe is lower than entries by 1 Amrani, Ram
     [not found] ` <SN1PR07MB22076C5DE03F1939603C554CF8BC0-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-11-14 12:01   ` Leon Romanovsky
     [not found]     ` <20161114120153.GC4240-2ukJVAZIZ/Y@public.gmane.org>
2016-11-14 12:05       ` Amrani, Ram
     [not found]         ` <2DF5C492-C364-4353-8FA9-51FA5EE760F0@mellanox.com>
     [not found]           ` <2DF5C492-C364-4353-8FA9-51FA5EE760F0-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-16  9:45             ` Amrani, Ram
     [not found]               ` <84A08B2A-85D5-467C-AE80-63134CA07767@mellanox.com>
     [not found]                 ` <84A08B2A-85D5-467C-AE80-63134CA07767-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-16 10:05                   ` Amrani, Ram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox