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