Lines Matching refs:cq

9 static void *get_next_valid_cqe(struct erdma_cq *cq)  in get_next_valid_cqe()  argument
11 __be32 *cqe = get_queue_entry(cq->kern_cq.qbuf, cq->kern_cq.ci, in get_next_valid_cqe()
12 cq->depth, CQE_SHIFT); in get_next_valid_cqe()
16 return owner ^ !!(cq->kern_cq.ci & cq->depth) ? cqe : NULL; in get_next_valid_cqe()
19 static void notify_cq(struct erdma_cq *cq, u8 solcitied) in notify_cq() argument
22 FIELD_PREP(ERDMA_CQDB_IDX_MASK, (cq->kern_cq.notify_cnt)) | in notify_cq()
23 FIELD_PREP(ERDMA_CQDB_CQN_MASK, cq->cqn) | in notify_cq()
26 FIELD_PREP(ERDMA_CQDB_CMDSN_MASK, cq->kern_cq.cmdsn) | in notify_cq()
27 FIELD_PREP(ERDMA_CQDB_CI_MASK, cq->kern_cq.ci); in notify_cq()
29 *cq->kern_cq.db_record = db_data; in notify_cq()
30 writeq(db_data, cq->kern_cq.db); in notify_cq()
35 struct erdma_cq *cq = to_ecq(ibcq); in erdma_req_notify_cq() local
39 spin_lock_irqsave(&cq->kern_cq.lock, irq_flags); in erdma_req_notify_cq()
41 notify_cq(cq, (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED); in erdma_req_notify_cq()
43 if ((flags & IB_CQ_REPORT_MISSED_EVENTS) && get_next_valid_cqe(cq)) in erdma_req_notify_cq()
46 cq->kern_cq.notify_cnt++; in erdma_req_notify_cq()
48 spin_unlock_irqrestore(&cq->kern_cq.lock, irq_flags); in erdma_req_notify_cq()
110 static int erdma_poll_one_cqe(struct erdma_cq *cq, struct ib_wc *wc) in erdma_poll_one_cqe() argument
112 struct erdma_dev *dev = to_edev(cq->ibcq.device); in erdma_poll_one_cqe()
122 cqe = get_next_valid_cqe(cq); in erdma_poll_one_cqe()
126 cq->kern_cq.ci++; in erdma_poll_one_cqe()
183 struct erdma_cq *cq = to_ecq(ibcq); in erdma_poll_cq() local
187 spin_lock_irqsave(&cq->kern_cq.lock, flags); in erdma_poll_cq()
190 ret = erdma_poll_one_cqe(cq, wc + npolled); in erdma_poll_cq()
200 spin_unlock_irqrestore(&cq->kern_cq.lock, flags); in erdma_poll_cq()