| 713 | BP->FreeBuf(wc.wr_id); |
| 714 | } |
| 715 | bool GetMsg(ui64* resWorkId, int* resQPN, TIBMicroPeerTable* tbl) { |
| 716 | if (tbl->NeedParsePending()) { |
| 717 | for (TDeque<TPendingMessage>::iterator z = Pending.begin(); z != Pending.end(); ++z) { |
| 718 | if (!tbl->NeedQPN(z->QPN)) { |
| 719 | continue; |
| 720 | } |
| 721 | *resWorkId = z->WorkId; |
| 722 | *resQPN = z->QPN; |
| 723 | Pending.erase(z); |
| 724 | return true; |
| 725 | } |
| 726 | //printf("Stop parse pending\n"); |
| 727 | tbl->StopParsePending(); |
| 728 | } |
| 729 | for (;;) { |
| 730 | ibv_wc wc; |
| 731 | int rv = CQ->Poll(&wc, 1); |
| 732 | if (rv > 0) { |
| 733 | Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status); |
| 734 | if (wc.opcode & IBV_WC_RECV) { |
| 735 | BP->RequestPostRecv(); |
| 736 | if (tbl->NeedQPN(wc.qp_num)) { |
| 737 | *resWorkId = wc.wr_id; |
| 738 | *resQPN = wc.qp_num; |
| 739 | return true; |
| 740 | } else { |
| 741 | Pending.push_back(TPendingMessage(wc.qp_num, wc.wr_id)); |
| 742 | BP->PostRecv(); |
| 743 | } |
| 744 | } else { |
| 745 | WriteCompleted(wc); |
| 746 | } |
| 747 | } else { |
| 748 | return false; |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | bool ProcessSendCompletion(const ibv_wc& wc) { |
| 754 | Y_ABORT_UNLESS(wc.status == IBV_WC_SUCCESS, "WaitForMsg() fail, status %d", (int)wc.status); |
no test coverage detected