Lines Matching refs:cq

44 #define	HERMON_CQE_OWNER_IS_SW(cq, cqe)	((((uint8_t *)cqe)[31] >> 7) == \
45 ((cq->cq_consindx & cq->cq_size) >> cq->cq_log_cqsz))
69 #define cq_wrap_around_mask (cq->cq_size - 1)
104 * Takes the specified cq cmd and cq number and rings the cq doorbell
118 ((tavor_hw_uar_t *)ia_uar)->cq = HTOBE_64(doorbell);
126 ((tavor_hw_uar32_t *)ia_uar)->cq[0] =
128 ((tavor_hw_uar32_t *)ia_uar)->cq[1] =
133 &((tavor_hw_uar_t *)ia_uar)->cq);
529 dapli_hermon_cq_peek(ib_cq_handle_t cq, int *num_cqe)
539 cons_indx = cq->cq_consindx & cq_wrap_around_mask;
542 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
549 while (HERMON_CQE_OWNER_IS_SW(cq, cqe)) {
565 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
571 #define dapli_hermon_cq_update_ci(cq, dbp) \
572 (dbp)[0] = HTOBE_32(cq->cq_consindx & 0xFFFFFF)
579 dapli_hermon_cq_resize_helper(ib_cq_handle_t cq)
583 if ((cq->cq_resize_addr == 0) ||
584 (munmap((char *)cq->cq_addr, cq->cq_map_len) < 0)) {
586 "munmap(%p:0x%llx) failed(%d)\n", cq->cq_addr,
587 cq->cq_map_len, errno);
590 cq->cq_addr = cq->cq_resize_addr;
591 cq->cq_map_offset = cq->cq_resize_map_offset;
592 cq->cq_map_len = cq->cq_resize_map_len;
593 cq->cq_size = cq->cq_resize_size;
594 cq->cq_cqesz = cq->cq_resize_cqesz;
595 cq->cq_resize_addr = 0;
596 cq->cq_resize_map_offset = 0;
597 cq->cq_resize_map_len = 0;
598 cq->cq_resize_size = 0;
599 cq->cq_resize_cqesz = 0;
600 for (i = 0; (1 << i) < cq->cq_size; i++)
602 cq->cq_log_cqsz = i;
604 cq->cq_consindx++; /* consume the RESIZE cqe */
615 dapli_hermon_cq_poll(ib_cq_handle_t cq, ibt_wc_t *wc_p, uint_t num_wc,
625 cons_indx = cq->cq_consindx & cq_wrap_around_mask;
628 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
641 while (HERMON_CQE_OWNER_IS_SW(cq, cqe)) {
643 if (dapli_hermon_cq_resize_helper(cq))
645 cons_indx = cq->cq_consindx & cq_wrap_around_mask;
646 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
649 status = dapli_hermon_cq_cqe_consume(cq, cqe,
653 cq->cq_consindx++; /* incr the total counter */
659 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
683 dapli_hermon_cq_update_ci(cq, cq->cq_poll_dbp);
689 if (cq->cq_wrid_reap_head) /* look before leaping */
690 dapls_tavor_wrid_cq_reap(cq);
707 dapli_hermon_cq_poll_one(ib_cq_handle_t cq, ibt_wc_t *wc_p)
716 cons_indx = cq->cq_consindx & cq_wrap_around_mask;
719 cqe = (uint32_t *)&cq->cq_addr[cons_indx];
731 if (HERMON_CQE_OWNER_IS_SW(cq, cqe)) {
733 if (dapli_hermon_cq_resize_helper(cq))
737 status = dapli_hermon_cq_cqe_consume(cq, cqe, wc_p);
742 cq->cq_consindx++;
743 dapli_hermon_cq_update_ci(cq, cq->cq_poll_dbp);
747 if (cq->cq_wrid_reap_head) /* look before leaping */
748 dapls_tavor_wrid_cq_reap(cq);
977 * event for the cq is received. This code extracts the cmd_sn field
988 dapli_hermon_cq_notify(ib_cq_handle_t cq, int flags, uint32_t param)
998 cqnum = cq->cq_num;
999 target = cq->cq_arm_dbp;
1009 (cq->cq_consindx & 0xFFFFFF));
1013 dapli_hermon_cq_doorbell(cq->cq_iauar,
1015 cmd_sn, cq->cq_consindx);
1021 (cq->cq_consindx & 0xFFFFFF));
1025 dapli_hermon_cq_doorbell(cq->cq_iauar,
1027 cmd_sn, cq->cq_consindx);
1441 ib_cq_handle_t cq;
1453 cq = qp->qp_rq_cqhdl;
1460 cons_indx = cq->cq_consindx;
1463 cqe = &cq->cq_addr[cons_indx];
1481 /* update the pointer to the next cq entry */
1482 cqe = &cq->cq_addr[tail_cons_indx];
1493 cqe = &cq->cq_addr[check_indx];
1515 next_cqe = &cq->cq_addr[new_indx];
1547 cqe = &cq->cq_addr[indx];
1568 if ((removed_cqes != 0) && (cq->cq_consindx != cons_indx)) {
1573 cq->cq_consindx = cons_indx;
1574 dapli_hermon_cq_update_ci(cq, cq->cq_poll_dbp);
1624 dapli_hermon_cq_init(ib_cq_handle_t cq)
1628 (cq->cq_arm_dbp)[0] = HTOBE_32(1 << 28);
1629 for (i = 0; (1 << i) < cq->cq_size; i++)
1631 cq->cq_log_cqsz = i;
1632 cq->cq_consindx = 0;