aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cm.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 92b4c2b0308b..55ab284e22f2 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1362,7 +1362,10 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
1362 1362
1363 ep = lookup_tid(t, tid); 1363 ep = lookup_tid(t, tid);
1364 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1364 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
1365 BUG_ON(!ep); 1365 if (!ep) {
1366 printk(KERN_WARNING MOD "Abort rpl to freed endpoint\n");
1367 return 0;
1368 }
1366 mutex_lock(&ep->com.mutex); 1369 mutex_lock(&ep->com.mutex);
1367 switch (ep->com.state) { 1370 switch (ep->com.state) {
1368 case ABORTING: 1371 case ABORTING:
@@ -1410,6 +1413,24 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
1410 return 0; 1413 return 0;
1411 } 1414 }
1412 1415
1416 /*
1417 * Log interesting failures.
1418 */
1419 switch (status) {
1420 case CPL_ERR_CONN_RESET:
1421 case CPL_ERR_CONN_TIMEDOUT:
1422 break;
1423 default:
1424 printk(KERN_INFO MOD "Active open failure - "
1425 "atid %u status %u errno %d %pI4:%u->%pI4:%u\n",
1426 atid, status, status2errno(status),
1427 &ep->com.local_addr.sin_addr.s_addr,
1428 ntohs(ep->com.local_addr.sin_port),
1429 &ep->com.remote_addr.sin_addr.s_addr,
1430 ntohs(ep->com.remote_addr.sin_port));
1431 break;
1432 }
1433
1413 connect_reply_upcall(ep, status2errno(status)); 1434 connect_reply_upcall(ep, status2errno(status));
1414 state_set(&ep->com, DEAD); 1435 state_set(&ep->com, DEAD);
1415 1436
@@ -1593,7 +1614,7 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst,
1593 n, n->dev, 0); 1614 n, n->dev, 0);
1594 if (!ep->l2t) 1615 if (!ep->l2t)
1595 goto out; 1616 goto out;
1596 ep->mtu = dst_mtu(ep->dst); 1617 ep->mtu = dst_mtu(dst);
1597 ep->tx_chan = cxgb4_port_chan(n->dev); 1618 ep->tx_chan = cxgb4_port_chan(n->dev);
1598 ep->smac_idx = (cxgb4_port_viid(n->dev) & 0x7F) << 1; 1619 ep->smac_idx = (cxgb4_port_viid(n->dev) & 0x7F) << 1;
1599 step = cdev->rdev.lldi.ntxq / 1620 step = cdev->rdev.lldi.ntxq /
@@ -2656,6 +2677,12 @@ static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb)
2656 unsigned int tid = GET_TID(req); 2677 unsigned int tid = GET_TID(req);
2657 2678
2658 ep = lookup_tid(t, tid); 2679 ep = lookup_tid(t, tid);
2680 if (!ep) {
2681 printk(KERN_WARNING MOD
2682 "Abort on non-existent endpoint, tid %d\n", tid);
2683 kfree_skb(skb);
2684 return 0;
2685 }
2659 if (is_neg_adv_abort(req->status)) { 2686 if (is_neg_adv_abort(req->status)) {
2660 PDBG("%s neg_adv_abort ep %p tid %u\n", __func__, ep, 2687 PDBG("%s neg_adv_abort ep %p tid %u\n", __func__, ep,
2661 ep->hwtid); 2688 ep->hwtid);
@@ -2667,11 +2694,8 @@ static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb)
2667 2694
2668 /* 2695 /*
2669 * Wake up any threads in rdma_init() or rdma_fini(). 2696 * Wake up any threads in rdma_init() or rdma_fini().
2670 * However, this is not needed if com state is just
2671 * MPA_REQ_SENT
2672 */ 2697 */
2673 if (ep->com.state != MPA_REQ_SENT) 2698 c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
2674 c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
2675 sched(dev, skb); 2699 sched(dev, skb);
2676 return 0; 2700 return 0;
2677} 2701}