[openib-general][patch review] srp: fmr implementation,

Roland Dreier rdreier at cisco.com
Thu Apr 13 13:59:27 PDT 2006


One stupid but useful way to narrow this down would be to reproduce
the crash with the following patch applied on top...

Index: linux-kernel/infiniband/ulp/srp/ib_srp.c
===================================================================
--- linux-kernel.orig/infiniband/ulp/srp/ib_srp.c	2006-04-12 12:24:37.398566000 -0700
+++ linux-kernel/infiniband/ulp/srp/ib_srp.c	2006-04-13 13:57:45.793412000 -0700
@@ -428,7 +428,12 @@
 	target->state = SRP_TARGET_CONNECTING;
 	spin_unlock_irq(target->scsi_host->host_lock);
 
+	printk(KERN_ERR "%s/%d: about to disconnect...\n", __func__, __LINE__);
+
 	srp_disconnect_target(target);
+
+	printk(KERN_ERR "%s/%d: disconnected...\n", __func__, __LINE__);
+
 	/*
 	 * Now get a new local CM ID so that we avoid confusing the
 	 * target in case things are really fouled up.
@@ -442,23 +447,33 @@
 	ib_destroy_cm_id(target->cm_id);
 	target->cm_id = new_cm_id;
 
+	printk(KERN_ERR "%s/%d: got a new CM ID...\n", __func__, __LINE__);
+
 	qp_attr.qp_state = IB_QPS_RESET;
 	ret = ib_modify_qp(target->qp, &qp_attr, IB_QP_STATE);
 	if (ret)
 		goto err;
 
+	printk(KERN_ERR "%s/%d: Reset QP...\n", __func__, __LINE__);
+
 	ret = srp_init_qp(target, target->qp);
 	if (ret)
 		goto err;
 
+	printk(KERN_ERR "%s/%d: Init QP...\n", __func__, __LINE__);
+
 	while (ib_poll_cq(target->cq, 1, &wc) > 0)
 		; /* nothing */
 
+	printk(KERN_ERR "%s/%d: cleared CQ...\n", __func__, __LINE__);
+
 	list_for_each_entry(req, &target->req_queue, list) {
 		req->scmnd->result = DID_RESET << 16;
 		req->scmnd->scsi_done(req->scmnd);
 	}
 
+	printk(KERN_ERR "%s/%d: cleared request queue...\n", __func__, __LINE__);
+
 	target->rx_head	 = 0;
 	target->tx_head	 = 0;
 	target->tx_tail  = 0;
@@ -468,10 +483,14 @@
 	target->req_ring[SRP_SQ_SIZE - 1].next = -1;
 	INIT_LIST_HEAD(&target->req_queue);
 
+	printk(KERN_ERR "%s/%d: reinited req ring...\n", __func__, __LINE__);
+
 	ret = srp_connect_target(target);
 	if (ret)
 		goto err;
 
+	printk(KERN_ERR "%s/%d: connected target...\n", __func__, __LINE__);
+
 	spin_lock_irq(target->scsi_host->host_lock);
 	if (target->state == SRP_TARGET_CONNECTING) {
 		ret = 0;



More information about the general mailing list