* Return true if the queue pair is in an error state, false otherwise.
*/
bool is_error() const;
- void add_tx_wr(uint32_t amt) { tx_wr += amt; }
- void add_tx_wc(uint32_t amt) { tx_wc += amt; }
- uint32_t get_tx_wr() const { return tx_wr; }
- uint32_t get_tx_wc() const { return tx_wc; }
+ void add_tx_wr(uint32_t amt) { tx_wr_inflight += amt; }
+ void dec_tx_wr(uint32_t amt) { tx_wr_inflight -= amt; }
+ uint32_t get_tx_wr() const { return tx_wr_inflight; }
ibv_qp* get_qp() const { return qp; }
Infiniband::CompletionQueue* get_tx_cq() const { return txcq; }
Infiniband::CompletionQueue* get_rx_cq() const { return rxcq; }
uint32_t max_recv_wr;
uint32_t q_key;
bool dead;
- std::atomic<uint32_t> tx_wr = {0}; // counter for successful Tx WQEs
- std::atomic<uint32_t> tx_wc = {0}; // counter for successful Tx CQEs
+ std::atomic<uint32_t> tx_wr_inflight = {0}; // counter for inflight Tx WQEs
};
public:
Mutex::Locker l(lock); // FIXME reuse dead qp because creating one qp costs 1 ms
for (auto &i : dead_queue_pairs) {
// Bypass QPs that do not collect all Tx completions yet.
- if (i->get_tx_wc() != i->get_tx_wr())
+ if (i->get_tx_wr())
continue;
ldout(cct, 10) << __func__ << " finally delete qp=" << i << dendl;
delete i;
<< " len: " << response->byte_len << " , addr:" << chunk
<< " " << get_stack()->get_infiniband().wc_status_to_string(response->status) << dendl;
- // Update the Tx CQE counter.
QueuePair *qp = get_qp(response->qp_num);
if (qp)
- qp->add_tx_wc(1);
+ qp->dec_tx_wr(1);
if (response->status != IBV_WC_SUCCESS) {
perf_logger->inc(l_msgr_rdma_tx_total_wc_errors);