Skip to content

Commit 1b1a889

Browse files
Steve Wisedledford
authored andcommitted
iw_cxgb4: explicitly move the qp to ERROR state during flush
This forces the connection to abort if the application failed to disconnect before flushing. This is aligned with how the common flush services work. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent 12eb513 commit 1b1a889

File tree

1 file changed

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

1 file changed

+9
-0
lines changed

drivers/infiniband/hw/cxgb4/qp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,12 +1898,20 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
18981898
return 0;
18991899
}
19001900

1901+
static void move_qp_to_err(struct c4iw_qp *qp)
1902+
{
1903+
struct c4iw_qp_attributes attrs = { .next_state = C4IW_QP_STATE_ERROR };
1904+
1905+
(void)c4iw_modify_qp(qp->rhp, qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
1906+
}
1907+
19011908
void c4iw_drain_sq(struct ib_qp *ibqp)
19021909
{
19031910
struct c4iw_qp *qp = to_c4iw_qp(ibqp);
19041911
unsigned long flag;
19051912
bool need_to_wait;
19061913

1914+
move_qp_to_err(qp);
19071915
spin_lock_irqsave(&qp->lock, flag);
19081916
need_to_wait = !t4_sq_empty(&qp->wq);
19091917
spin_unlock_irqrestore(&qp->lock, flag);
@@ -1918,6 +1926,7 @@ void c4iw_drain_rq(struct ib_qp *ibqp)
19181926
unsigned long flag;
19191927
bool need_to_wait;
19201928

1929+
move_qp_to_err(qp);
19211930
spin_lock_irqsave(&qp->lock, flag);
19221931
need_to_wait = !t4_rq_empty(&qp->wq);
19231932
spin_unlock_irqrestore(&qp->lock, flag);

0 commit comments

Comments
 (0)