[Open-FCoE] [PATCH 25/28] libfc: remove the fc_lport_set_fid function

Robert Love robert.w.love at intel.com
Tue Sep 30 18:27:01 UTC 2008


We shouldn't be hiding the fact that we're resetting the
rport list in the set_fid function. Sure, setting the
fid to 0 is an indication that we've been reset. I think
a better indication would be when we _enter_reset().

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/libfc/fc_lport.c |   28 +++++++---------------------
 1 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 82a787b..0f65577 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -254,24 +254,6 @@ fc_lport_flogi_fill(struct fc_lport *lport, struct fc_els_flogi *flogi,
 }
 
 /*
- * Set the fid. This indicates that we have a new connection to the
- * fabric so we should reset our list of fc_rports. Passing a fid of
- * 0 will also reset the rport list regardless of the previous fid.
- */
-static void fc_lport_set_fid(struct fc_lport *lport, u32 fid)
-{
-	if (fid != 0 && lport->fid == fid)
-		return;
-
-	if (fc_lport_debug)
-		FC_DBG("changing local port fid from %x to %x\n",
-		       lport->fid, fid);
-	lport->fid = fid;
-	fc_host_port_id(lport->host) = fid;
-	lport->tt.rport_reset_list(lport);
-}
-
-/*
  * Add a supported FC-4 type.
  */
 static void fc_lport_add_fc4_type(struct fc_lport *lport, enum fc_fh_type type)
@@ -568,7 +550,8 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
 	} else if (!remote_fid) {
 		remote_fid = FC_LOCAL_PTP_FID_HI;
 	}
-	fc_lport_set_fid(lport, local_fid);
+
+	lport->fid = local_fid;
 
 	fp = fc_frame_alloc(lport, sizeof(*flp));
 	if (fp) {
@@ -695,6 +678,8 @@ int fc_lport_enter_reset(struct fc_lport *lport)
 
 	fc_block_rports(lport);
 
+	lport->tt.rport_reset_list(lport);
+
 	/*
 	 * Setting state RESET keeps fc_lport_error() callbacks
 	 * by exch_mgr_reset() from recursing on the lock.
@@ -704,7 +689,8 @@ int fc_lport_enter_reset(struct fc_lport *lport)
 	fc_lport_state_enter(lport, LPORT_ST_RESET);
 	lport->tt.exch_mgr_reset(lport->emp, 0, 0);
 	fc_host_fabric_name(lport->host) = 0;
-	fc_lport_set_fid(lport, 0);
+	lport->fid = 0;
+
 	if ((lport->link_status & FC_LINK_UP) == FC_LINK_UP)
 		fc_lport_enter_flogi(lport);
 
@@ -1096,7 +1082,7 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
 		if (fc_lport_debug)
 			FC_DBG("assigned fid %x\n", did);
 		fc_lport_lock(lport);
-		fc_lport_set_fid(lport, did);
+		lport->fid = did;
 		flp = fc_frame_payload_get(fp, sizeof(*flp));
 		if (flp) {
 			mfs = ntohs(flp->fl_csp.sp_bb_data) &




More information about the devel mailing list