Skip to content

Commit

Permalink
issue: 3604175 Fixing stuck empty rx ring cleanup
Browse files Browse the repository at this point in the history
When the ring is destroyed and the RQ is empty the termination loop becomes infinte.
It waits for the last_posted_wqe to be retrieved. but since it is empty the last posted wqe was already retrieved.

Signed-off-by: Alexander Grissik <[email protected]>
  • Loading branch information
AlexanderGrissik committed Sep 12, 2023
1 parent e3d75c3 commit 6fe417f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vma/dev/qp_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ void qp_mgr::release_rx_buffers()
qp_logdbg("draining rx cq_mgr %p (last_posted_rx_wr_id = %lu)", m_p_cq_mgr_rx, m_last_posted_rx_wr_id);
uintptr_t last_polled_rx_wr_id = 0;
while (m_p_cq_mgr_rx && last_polled_rx_wr_id != m_last_posted_rx_wr_id &&
errno != EIO && !m_p_ib_ctx_handler->is_removed()) {
errno != EIO && !m_p_ib_ctx_handler->is_removed() &&
!is_rq_empty()) {

// Process the FLUSH'ed WQE's
int ret = m_p_cq_mgr_rx->drain_and_proccess(&last_polled_rx_wr_id);
Expand Down
1 change: 1 addition & 0 deletions src/vma/dev/qp_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ friend class cq_mgr_mp;

virtual int send_to_wire(vma_ibv_send_wr* p_send_wqe, vma_wr_tx_packet_attr attr, bool request_comp);
virtual bool is_completion_need() { return !m_n_unsignaled_count; };
virtual bool is_rq_empty() const { return false; }
};

class qp_mgr_eth : public qp_mgr
Expand Down
2 changes: 2 additions & 0 deletions src/vma/dev/qp_mgr_eth_mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ friend class cq_mgr_mlx5;
void trigger_completion_for_all_sent_packets();
void init_sq();

virtual bool is_rq_empty() const { return (m_mlx5_qp.rq.head == m_mlx5_qp.rq.tail); }

uint64_t* m_sq_wqe_idx_to_wrid;
uint64_t m_rq_wqe_counter;
private:
Expand Down

0 comments on commit 6fe417f

Please sign in to comment.