Commit a52bf98d authored by Steve Wise's avatar Steve Wise Committed by Roland Dreier

RDMA/cxgb3: Wake up any waiters on peer close/abort

A close/abort while waiting for a wr_ack during connection migration
can cause a hung process in iwch_accept_cr/iwch_reject_cr.

The fix is to set rpl_error/rpl_done and wake up the waiters when we
get a close/abort while in MPA_REQ_RCVD state.
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 6e47fe43
...@@ -1478,9 +1478,14 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1478,9 +1478,14 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
/* /*
* We're gonna mark this puppy DEAD, but keep * We're gonna mark this puppy DEAD, but keep
* the reference on it until the ULP accepts or * the reference on it until the ULP accepts or
* rejects the CR. * rejects the CR. Also wake up anyone waiting
* in rdma connection migration (see iwch_accept_cr()).
*/ */
__state_set(&ep->com, CLOSING); __state_set(&ep->com, CLOSING);
ep->com.rpl_done = 1;
ep->com.rpl_err = -ECONNRESET;
PDBG("waking up ep %p\n", ep);
wake_up(&ep->com.waitq);
break; break;
case MPA_REP_SENT: case MPA_REP_SENT:
__state_set(&ep->com, CLOSING); __state_set(&ep->com, CLOSING);
...@@ -1588,8 +1593,13 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1588,8 +1593,13 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
/* /*
* We're gonna mark this puppy DEAD, but keep * We're gonna mark this puppy DEAD, but keep
* the reference on it until the ULP accepts or * the reference on it until the ULP accepts or
* rejects the CR. * rejects the CR. Also wake up anyone waiting
* in rdma connection migration (see iwch_accept_cr()).
*/ */
ep->com.rpl_done = 1;
ep->com.rpl_err = -ECONNRESET;
PDBG("waking up ep %p\n", ep);
wake_up(&ep->com.waitq);
break; break;
case MORIBUND: case MORIBUND:
case CLOSING: case CLOSING:
...@@ -1828,8 +1838,6 @@ int iwch_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) ...@@ -1828,8 +1838,6 @@ int iwch_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
ep->com.cm_id = cm_id; ep->com.cm_id = cm_id;
ep->com.qp = qp; ep->com.qp = qp;
ep->com.rpl_done = 0;
ep->com.rpl_err = 0;
ep->ird = conn_param->ird; ep->ird = conn_param->ird;
ep->ord = conn_param->ord; ep->ord = conn_param->ord;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment