提交 1b1a889d 编写于 作者: S Steve Wise 提交者: Doug Ledford

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: NSteve Wise <swise@opengridcomputing.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 12eb5137
...@@ -1898,12 +1898,20 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, ...@@ -1898,12 +1898,20 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
return 0; return 0;
} }
static void move_qp_to_err(struct c4iw_qp *qp)
{
struct c4iw_qp_attributes attrs = { .next_state = C4IW_QP_STATE_ERROR };
(void)c4iw_modify_qp(qp->rhp, qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
}
void c4iw_drain_sq(struct ib_qp *ibqp) void c4iw_drain_sq(struct ib_qp *ibqp)
{ {
struct c4iw_qp *qp = to_c4iw_qp(ibqp); struct c4iw_qp *qp = to_c4iw_qp(ibqp);
unsigned long flag; unsigned long flag;
bool need_to_wait; bool need_to_wait;
move_qp_to_err(qp);
spin_lock_irqsave(&qp->lock, flag); spin_lock_irqsave(&qp->lock, flag);
need_to_wait = !t4_sq_empty(&qp->wq); need_to_wait = !t4_sq_empty(&qp->wq);
spin_unlock_irqrestore(&qp->lock, flag); spin_unlock_irqrestore(&qp->lock, flag);
...@@ -1918,6 +1926,7 @@ void c4iw_drain_rq(struct ib_qp *ibqp) ...@@ -1918,6 +1926,7 @@ void c4iw_drain_rq(struct ib_qp *ibqp)
unsigned long flag; unsigned long flag;
bool need_to_wait; bool need_to_wait;
move_qp_to_err(qp);
spin_lock_irqsave(&qp->lock, flag); spin_lock_irqsave(&qp->lock, flag);
need_to_wait = !t4_rq_empty(&qp->wq); need_to_wait = !t4_rq_empty(&qp->wq);
spin_unlock_irqrestore(&qp->lock, flag); spin_unlock_irqrestore(&qp->lock, flag);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册