RDMA/cxgb4: Use vmalloc() for debugfs QP dump
authorVipul Pandya <vipul@chelsio.com>
Fri, 18 May 2012 09:59:31 +0000 (15:29 +0530)
committerRoland Dreier <roland@purestorage.com>
Fri, 18 May 2012 20:22:35 +0000 (13:22 -0700)
This allows dumping thousands of QPs.  Log active open failures of
interest.

Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/cxgb4/cm.c
drivers/infiniband/hw/cxgb4/device.c

index 6ce401abdbd004d39b89368e7b5c6b7f6cd4ec06..55ab284e22f2c02c037ca67825d24e3d8a827208 100644 (file)
@@ -1413,6 +1413,24 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
                return 0;
        }
 
+       /*
+        * Log interesting failures.
+        */
+       switch (status) {
+       case CPL_ERR_CONN_RESET:
+       case CPL_ERR_CONN_TIMEDOUT:
+               break;
+       default:
+               printk(KERN_INFO MOD "Active open failure - "
+                      "atid %u status %u errno %d %pI4:%u->%pI4:%u\n",
+                      atid, status, status2errno(status),
+                      &ep->com.local_addr.sin_addr.s_addr,
+                      ntohs(ep->com.local_addr.sin_port),
+                      &ep->com.remote_addr.sin_addr.s_addr,
+                      ntohs(ep->com.remote_addr.sin_port));
+               break;
+       }
+
        connect_reply_upcall(ep, status2errno(status));
        state_set(&ep->com, DEAD);
 
index bdb398f54a64e31fe498d33888b000c7239c72bf..854562915413f41efb802bd2f80c5d42c3a29b60 100644 (file)
@@ -121,7 +121,7 @@ static int qp_release(struct inode *inode, struct file *file)
                printk(KERN_INFO "%s null qpd?\n", __func__);
                return 0;
        }
-       kfree(qpd->buf);
+       vfree(qpd->buf);
        kfree(qpd);
        return 0;
 }
@@ -145,7 +145,7 @@ static int qp_open(struct inode *inode, struct file *file)
        spin_unlock_irq(&qpd->devp->lock);
 
        qpd->bufsize = count * 128;
-       qpd->buf = kmalloc(qpd->bufsize, GFP_KERNEL);
+       qpd->buf = vmalloc(qpd->bufsize);
        if (!qpd->buf) {
                ret = -ENOMEM;
                goto err1;