Skip to content

Commit 42e6ddd

Browse files
Anumula-Murali-Mohan-Reddyrleon
authored andcommitted
RDMA/cxgb4: Notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event
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 <[email protected]> Signed-off-by: Potnuri Bharat Teja <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 9264cd6 commit 42e6ddd

File tree

1 file changed

+8
-0
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+8
-0
lines changed

drivers/infiniband/hw/cxgb4/qp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,7 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
15991599
int count;
16001600
int rq_flushed = 0, sq_flushed;
16011601
unsigned long flag;
1602+
struct ib_event ev;
16021603

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

@@ -1607,6 +1608,13 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
16071608
if (schp != rchp)
16081609
spin_lock(&schp->lock);
16091610
spin_lock(&qhp->lock);
1611+
if (qhp->srq && qhp->attr.state == C4IW_QP_STATE_ERROR &&
1612+
qhp->ibqp.event_handler) {
1613+
ev.device = qhp->ibqp.device;
1614+
ev.element.qp = &qhp->ibqp;
1615+
ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
1616+
qhp->ibqp.event_handler(&ev, qhp->ibqp.qp_context);
1617+
}
16101618

16111619
if (qhp->wq.flushed) {
16121620
spin_unlock(&qhp->lock);

0 commit comments

Comments
 (0)