Lines Matching defs:buf
159 static inline struct mthca_cqe *get_cqe_from_buf(struct mthca_cq_buf *buf,
162 if (buf->is_direct)
163 return buf->queue.direct.buf + (entry * MTHCA_CQ_ENTRY_SIZE);
165 return buf->queue.page_list[entry * MTHCA_CQ_ENTRY_SIZE / PAGE_SIZE].buf
171 return get_cqe_from_buf(&cq->buf, entry);
343 memcpy(get_cqe_from_buf(&cq->resize_buf->buf,
348 int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent)
355 &buf->queue, &buf->is_direct,
356 &dev->driver_pd, 1, &buf->mr);
361 set_cqe_hw(get_cqe_from_buf(buf, i));
366 void mthca_free_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int cqe)
368 mthca_buf_free(dev, (cqe + 1) * MTHCA_CQ_ENTRY_SIZE, &buf->queue,
369 buf->is_direct, &buf->mr);
700 if (cqe_sw(get_cqe_from_buf(&cq->resize_buf->buf,
705 tbuf = cq->buf;
707 cq->buf = cq->resize_buf->buf;
710 cq->resize_buf->buf = tbuf;
811 cq_context = mailbox->buf;
814 err = mthca_alloc_cq_buf(dev, &cq->buf, nent);
836 cq_context->lkey = cpu_to_be32(cq->buf.mr.ibmr.lkey);
867 mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe);
917 __be32 *ctx = mailbox->buf;
941 mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe);