提交 42e31753 编写于 作者: S Steve Wise 提交者: Roland Dreier

RDMA/cxgb3: Fixes for "normal close" failures

Fixes for "normal close" failures:

- Start normal close timer when moving to CLOSING state.
- Handle ABORTING state in close_con_rpl().
- Stop timer correctly on abort during a normal close.
Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 c3bb1092
...@@ -1415,6 +1415,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1415,6 +1415,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
wake_up(&ep->com.waitq); wake_up(&ep->com.waitq);
break; break;
case FPDU_MODE: case FPDU_MODE:
start_ep_timer(ep);
__state_set(&ep->com, CLOSING); __state_set(&ep->com, CLOSING);
attrs.next_state = IWCH_QP_STATE_CLOSING; attrs.next_state = IWCH_QP_STATE_CLOSING;
iwch_modify_qp(ep->com.qp->rhp, ep->com.qp, iwch_modify_qp(ep->com.qp->rhp, ep->com.qp,
...@@ -1425,7 +1426,6 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1425,7 +1426,6 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
disconnect = 0; disconnect = 0;
break; break;
case CLOSING: case CLOSING:
start_ep_timer(ep);
__state_set(&ep->com, MORIBUND); __state_set(&ep->com, MORIBUND);
disconnect = 0; disconnect = 0;
break; break;
...@@ -1507,9 +1507,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1507,9 +1507,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
get_ep(&ep->com); get_ep(&ep->com);
break; break;
case MORIBUND: case MORIBUND:
case CLOSING:
stop_ep_timer(ep); stop_ep_timer(ep);
/*FALLTHROUGH*/
case FPDU_MODE: case FPDU_MODE:
case CLOSING:
if (ep->com.cm_id && ep->com.qp) { if (ep->com.cm_id && ep->com.qp) {
attrs.next_state = IWCH_QP_STATE_ERROR; attrs.next_state = IWCH_QP_STATE_ERROR;
ret = iwch_modify_qp(ep->com.qp->rhp, ret = iwch_modify_qp(ep->com.qp->rhp,
...@@ -1570,7 +1571,6 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1570,7 +1571,6 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
spin_lock_irqsave(&ep->com.lock, flags); spin_lock_irqsave(&ep->com.lock, flags);
switch (ep->com.state) { switch (ep->com.state) {
case CLOSING: case CLOSING:
start_ep_timer(ep);
__state_set(&ep->com, MORIBUND); __state_set(&ep->com, MORIBUND);
break; break;
case MORIBUND: case MORIBUND:
...@@ -1586,6 +1586,8 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1586,6 +1586,8 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
__state_set(&ep->com, DEAD); __state_set(&ep->com, DEAD);
release = 1; release = 1;
break; break;
case ABORTING:
break;
case DEAD: case DEAD:
default: default:
BUG_ON(1); BUG_ON(1);
...@@ -1659,6 +1661,7 @@ static void ep_timeout(unsigned long arg) ...@@ -1659,6 +1661,7 @@ static void ep_timeout(unsigned long arg)
break; break;
case MPA_REQ_WAIT: case MPA_REQ_WAIT:
break; break;
case CLOSING:
case MORIBUND: case MORIBUND:
if (ep->com.cm_id && ep->com.qp) { if (ep->com.cm_id && ep->com.qp) {
attrs.next_state = IWCH_QP_STATE_ERROR; attrs.next_state = IWCH_QP_STATE_ERROR;
...@@ -1956,11 +1959,11 @@ int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, gfp_t gfp) ...@@ -1956,11 +1959,11 @@ int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, gfp_t gfp)
case MPA_REQ_RCVD: case MPA_REQ_RCVD:
case MPA_REP_SENT: case MPA_REP_SENT:
case FPDU_MODE: case FPDU_MODE:
start_ep_timer(ep);
ep->com.state = CLOSING; ep->com.state = CLOSING;
close = 1; close = 1;
break; break;
case CLOSING: case CLOSING:
start_ep_timer(ep);
ep->com.state = MORIBUND; ep->com.state = MORIBUND;
close = 1; close = 1;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册