[Open-FCoE] [PATCH 2/5] libfc: add fc_rport_terminate_io callback

Chris Leech christopher.leech at intel.com
Thu Sep 25 19:07:43 UTC 2008


Add a callback function from the FC transport to abort I/O on a remote port 
when it is deleted from the system.

Signed-off-by: Chris Leech <christopher.leech at intel.com>
---

 drivers/scsi/fcoe/fcoeinit.c  |    2 ++
 drivers/scsi/libfc/fc_rport.c |    9 +++++++++
 include/scsi/libfc/libfc.h    |    1 +
 3 files changed, 12 insertions(+), 0 deletions(-)


diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c
index 419ced9..b536509 100644
--- a/drivers/scsi/fcoe/fcoeinit.c
+++ b/drivers/scsi/fcoe/fcoeinit.c
@@ -89,6 +89,8 @@ struct fc_function_template fcoe_transport_function = {
 	.show_rport_dev_loss_tmo = 1,
 	.get_fc_host_stats = fc_get_host_stats,
 	.issue_fc_host_lip = fcoe_reset,
+
+	.terminate_rport_io = fc_rport_terminate_io,
 };
 
 struct fcoe_percpu_s *fcoe_percpu[NR_CPUS];
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index f9ede2c..91cc0d5 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1299,3 +1299,12 @@ int fc_rport_init(struct fc_lport *lp)
 }
 EXPORT_SYMBOL(fc_rport_init);
 
+void fc_rport_terminate_io(struct fc_rport *rport)
+{
+	struct fc_rport_libfc_priv *rp = rport->dd_data;
+	struct fc_lport *lp = rp->local_port;
+
+	lp->tt.exch_mgr_reset(lp->emp, 0, rport->port_id);
+	lp->tt.exch_mgr_reset(lp->emp, rport->port_id, 0);
+}
+EXPORT_SYMBOL(fc_rport_terminate_io);
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 771640d..d56e526 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -560,6 +560,7 @@ int fc_set_mfs(struct fc_lport *lp, u32 mfs);
  * REMOTE PORT LAYER
  *****************************/
 int fc_rport_init(struct fc_lport *lp);
+void fc_rport_terminate_io(struct fc_rport *rp);
 
 
 /**




More information about the devel mailing list