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);
87 wc->
uqueue[head].qp_num = entry->
qp->qp_num;
112 spin_unlock_irqrestore(&cq->
lock, flags);
115 to_idev(cq->
ibcq.device)->n_wqe_errs++;
150 if (tail == wc->
head)
154 if (tail >= cq->
ibcq.cqe)
161 spin_unlock_irqrestore(&cq->
lock, flags);
167 static void send_complete(
unsigned long data)
233 sz +=
sizeof(
struct ib_wc) * (entries + 1);
253 err = ib_copy_to_udata(udata, &cq->
ip->offset,
254 sizeof(cq->
ip->offset));
360 spin_unlock_irqrestore(&cq->
lock, flags);
392 sz +=
sizeof(
struct ib_wc) * (cqe + 1);
403 ret = ib_copy_to_udata(udata, &offset,
sizeof(offset));
408 spin_lock_irq(&cq->
lock);
428 for (n = 0; tail !=
head; n++) {
433 if (tail == (
u32) cq->
ibcq.cqe)
442 spin_unlock_irq(&cq->
lock);
457 ret = ib_copy_to_udata(udata, &ip->
offset,
473 spin_unlock_irq(&cq->
lock);