35 #include <linux/slab.h>
63 if (head >= (
unsigned) cq->
ibcq.cqe) {
69 spin_unlock_irqrestore(&cq->
lock, flags);
70 if (cq->
ibcq.event_handler) {
76 cq->
ibcq.event_handler(&ev, cq->
ibcq.cq_context);
88 wc->
uqueue[head].qp_num = entry->
qp->qp_num;
114 spin_unlock_irqrestore(&cq->
lock, flags);
130 struct qib_cq *cq = to_icq(ibcq);
149 if (tail == wc->
head)
153 if (tail >= cq->
ibcq.cqe)
160 spin_unlock_irqrestore(&cq->
lock, flags);
240 sz +=
sizeof(
struct ib_wc) * (entries + 1);
260 err = ib_copy_to_udata(udata, &cq->
ip->offset,
261 sizeof(cq->
ip->offset));
324 struct qib_cq *cq = to_icq(ibcq);
351 struct qib_cq *cq = to_icq(ibcq);
367 spin_unlock_irqrestore(&cq->
lock, flags);
380 struct qib_cq *cq = to_icq(ibcq);
399 sz +=
sizeof(
struct ib_wc) * (cqe + 1);
410 ret = ib_copy_to_udata(udata, &offset,
sizeof(offset));
415 spin_lock_irq(&cq->
lock);
435 for (n = 0; tail !=
head; n++) {
440 if (tail == (
u32) cq->
ibcq.cqe)
449 spin_unlock_irq(&cq->
lock);
464 ret = ib_copy_to_udata(udata, &ip->
offset,
480 spin_unlock_irq(&cq->
lock);