| 792 | WaitCompletion(&wc); |
| 793 | } |
| 794 | ui64 WaitForMsg(int qpn) { |
| 795 | for (TDeque<TPendingMessage>::iterator z = Pending.begin(); z != Pending.end(); ++z) { |
| 796 | if (z->QPN == qpn) { |
| 797 | ui64 workId = z->WorkId; |
| 798 | Pending.erase(z); |
| 799 | return workId; |
| 800 | } |
| 801 | } |
| 802 | ibv_wc wc; |
| 803 | for (;;) { |
| 804 | int rv = CQ->Poll(&wc, 1); |
| 805 | if (rv > 0) { |
| 806 | Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status); |
| 807 | if (wc.opcode & IBV_WC_RECV) { |
| 808 | BP->RequestPostRecv(); |
| 809 | if ((int)wc.qp_num == qpn) { |
| 810 | return wc.wr_id; |
| 811 | } else { |
| 812 | Pending.push_back(TPendingMessage(wc.qp_num, wc.wr_id)); |
| 813 | BP->PostRecv(); |
| 814 | } |
| 815 | } else { |
| 816 | WriteCompleted(wc); |
| 817 | } |
| 818 | } |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | bool AllocOperationSlot(TPtrArg<TRCQueuePair> qp) { |
| 823 | int way = qp->GetQPN() & (SEND_COUNT_TABLE_SIZE - 1); |
nothing calls this directly
no test coverage detected