We should 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 <[EMAIL PROTECTED]>
---
drivers/scsi/libfc/fc_lport.c | 28 ++++++++--------------------
1 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 9a1964e..708332f 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -200,23 +200,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;
- 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)
@@ -534,7 +517,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) {
@@ -658,6 +642,8 @@ int fc_lport_enter_reset(struct fc_lport *lport)
}
fc_lport_ptp_clear(lport);
+ lport->tt.rport_reset_list(lport);
+
/*
* Setting state RESET keeps fc_lport_error() callbacks
* by exch_mgr_reset() from recursing on the lock.
@@ -666,7 +652,9 @@ 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_lport_set_fid(lport, 0);
+
+ lport->fid = 0;
+
if ((lport->link_status & FC_LINK_UP) == FC_LINK_UP)
fc_lport_enter_flogi(lport);
return 0;
@@ -1043,7 +1031,7 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct
fc_frame *fp, void *lp
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) &
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel