Skip to content

Commit

Permalink
RDMA/cxgb4: Notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event
Browse files Browse the repository at this point in the history
This patch sends IB_EVENT_QP_LAST_WQE_REACHED event on a QP that is in
error state and associated with an SRQ. This behaviour is incorporated
in flush_qp() which is called when QP transitions to error state.
Supports SRQ drain functionality added by commit 844bc12 ("IB/core:
add support for draining Shared receive queues")

Fixes: 844bc12 ("IB/core: add support for draining Shared receive queues")
Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Link: https://patch.msgid.link/20250107095053.81007-1-anumula@chelsio.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
  • Loading branch information
Anumula Murali Mohan Reddy authored and Leon Romanovsky committed Jan 14, 2025
1 parent 9264cd6 commit 42e6ddd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/infiniband/hw/cxgb4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,7 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
int count;
int rq_flushed = 0, sq_flushed;
unsigned long flag;
struct ib_event ev;

pr_debug("qhp %p rchp %p schp %p\n", qhp, rchp, schp);

Expand All @@ -1607,6 +1608,13 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
if (schp != rchp)
spin_lock(&schp->lock);
spin_lock(&qhp->lock);
if (qhp->srq && qhp->attr.state == C4IW_QP_STATE_ERROR &&
qhp->ibqp.event_handler) {
ev.device = qhp->ibqp.device;
ev.element.qp = &qhp->ibqp;
ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
qhp->ibqp.event_handler(&ev, qhp->ibqp.qp_context);
}

if (qhp->wq.flushed) {
spin_unlock(&qhp->lock);
Expand Down

0 comments on commit 42e6ddd

Please sign in to comment.