aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2013-01-07 08:11:50 -0500
committerRoland Dreier <roland@purestorage.com>2013-02-14 18:51:55 -0500
commit55abf8df0aa080eb474f7f46337503351890b361 (patch)
treea09eaeb3e5584cb08c2fdd22c3cdf47e62815c3c /drivers/infiniband/hw/cxgb4
parent836dc9e3fbbab0c30aa6e664417225f5c1fb1c39 (diff)
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.c19
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)
1391 skb_pull(skb, sizeof(*hdr)); 1391 skb_pull(skb, sizeof(*hdr));
1392 skb_trim(skb, dlen); 1392 skb_trim(skb, dlen);
1393 1393
1394 ep->rcv_seq += dlen;
1395 BUG_ON(ep->rcv_seq != (ntohl(hdr->seq) + dlen));
1396
1397 /* update RX credits */ 1394 /* update RX credits */
1398 update_rx_credits(ep, dlen); 1395 update_rx_credits(ep, dlen);
1399 1396
1400 switch (state_read(&ep->com)) { 1397 switch (state_read(&ep->com)) {
1401 case MPA_REQ_SENT: 1398 case MPA_REQ_SENT:
1399 ep->rcv_seq += dlen;
1402 process_mpa_reply(ep, skb); 1400 process_mpa_reply(ep, skb);
1403 break; 1401 break;
1404 case MPA_REQ_WAIT: 1402 case MPA_REQ_WAIT:
1403 ep->rcv_seq += dlen;
1405 process_mpa_request(ep, skb); 1404 process_mpa_request(ep, skb);
1406 break; 1405 break;
1407 case MPA_REP_SENT:
1408 break;
1409 default: 1406 default:
1410 pr_err("%s Unexpected streaming data." \ 1407 pr_err("%s Unexpected streaming data." \
1411 " ep %p state %d tid %u status %d\n", 1408 " ep %p state %d tid %u status %d\n",
1412 __func__, ep, state_read(&ep->com), ep->hwtid, status); 1409 __func__, ep, state_read(&ep->com), ep->hwtid, status);
1413 1410
1414 /* 1411 if (ep->com.qp) {
1415 * The ep will timeout and inform the ULP of the failure. 1412 struct c4iw_qp_attributes attrs;
1416 * See ep_timeout(). 1413
1417 */ 1414 attrs.next_state = C4IW_QP_STATE_ERROR;
1415 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
1416 C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
1417 }
1418 c4iw_ep_disconnect(ep, 1, GFP_KERNEL);
1418 break; 1419 break;
1419 } 1420 }
1420 return 0; 1421 return 0;