public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* mlx4_wq_overflow question
@ 2012-02-08 22:45 Eli Cohen
  2012-02-09 17:39 ` Roland Dreier
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Cohen @ 2012-02-08 22:45 UTC (permalink / raw)
  To: roland-DgEjT+Ai2ygdnm+yROfE0A, RDMA list

Hi Roland,

referring to the function below, I can't find a strong reason to check
again after acquiring the cq spinlock. Any idea?

static int mlx4_wq_overflow(struct mlx4_ib_wq *wq, int nreq, struct
ib_cq *ib_cq)
{
        unsigned cur;
        struct mlx4_ib_cq *cq;

        cur = wq->head - wq->tail;
        if (likely(cur + nreq < wq->max_post))
                return 0;

        cq = to_mcq(ib_cq);
        spin_lock(&cq->lock);
        cur = wq->head - wq->tail;
        spin_unlock(&cq->lock);

        return cur + nreq >= wq->max_post;
}
--
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] 2+ messages in thread

end of thread, other threads:[~2012-02-09 17:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 22:45 mlx4_wq_overflow question Eli Cohen
2012-02-09 17:39 ` Roland Dreier

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