diff options
author | Vipul Pandya <vipul@chelsio.com> | 2013-01-07 13:11:50 +0000 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-02-14 15:51:55 -0800 |
commit | 55abf8df0aa080eb474f7f46337503351890b361 (patch) | |
tree | a09eaeb3e5584cb08c2fdd22c3cdf47e62815c3c /drivers/infiniband/hw/cxgb4 | |
parent | 836dc9e3fbbab0c30aa6e664417225f5c1fb1c39 (diff) | |
download | linux-55abf8df0aa080eb474f7f46337503351890b361.tar.gz linux-55abf8df0aa080eb474f7f46337503351890b361.tar.bz2 linux-55abf8df0aa080eb474f7f46337503351890b361.zip |
RDMA/cxgb4: Abort connections that receive unexpected streaming mode data
This error means the RDMA connection was knocked out of RDMA mode,
probably due to an error on the connection.
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index c13745cde7fa..9cab6a6eb96a 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -1391,30 +1391,31 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff *skb) skb_pull(skb, sizeof(*hdr)); skb_trim(skb, dlen); - ep->rcv_seq += dlen; - BUG_ON(ep->rcv_seq != (ntohl(hdr->seq) + dlen)); - /* update RX credits */ update_rx_credits(ep, dlen); switch (state_read(&ep->com)) { case MPA_REQ_SENT: + ep->rcv_seq += dlen; process_mpa_reply(ep, skb); break; case MPA_REQ_WAIT: + ep->rcv_seq += dlen; process_mpa_request(ep, skb); break; - case MPA_REP_SENT: - break; default: pr_err("%s Unexpected streaming data." \ " ep %p state %d tid %u status %d\n", __func__, ep, state_read(&ep->com), ep->hwtid, status); - /* - * The ep will timeout and inform the ULP of the failure. - * See ep_timeout(). - */ + if (ep->com.qp) { + struct c4iw_qp_attributes attrs; + + attrs.next_state = C4IW_QP_STATE_ERROR; + c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + } + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); break; } return 0; |