[Open-FCoE] [PATCH 15/28] libfc: use FC_FID_DIR_SERV to determine NS

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


Don't use lp->dns_rp->port_id or rport == lp->dns_rp
to determine if the rport is to the NS. Simply look
at the the fid.

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

 drivers/scsi/libfc/fc_ns.c    |    6 +++---
 drivers/scsi/libfc/fc_rport.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/libfc/fc_ns.c b/drivers/scsi/libfc/fc_ns.c
index e40ddf4..1f03b01 100644
--- a/drivers/scsi/libfc/fc_ns.c
+++ b/drivers/scsi/libfc/fc_ns.c
@@ -249,7 +249,7 @@ static void fc_ns_enter_reg_ft(struct fc_lport *lp)
 						  fc_ns_resp, NULL, lp,
 						  lp->e_d_tov,
 						  lp->fid,
-						  lp->dns_rp->port_id,
+						  FC_FID_DIR_SERV,
 						  FC_FC_SEQ_INIT |
 						  FC_FC_END_SEQ))
 				fc_ns_retry(lp);
@@ -603,7 +603,7 @@ static void fc_ns_gpn_ft_req(struct fc_lport *lp)
 					  fc_ns_gpn_ft_resp, NULL,
 					  lp, lp->e_d_tov,
 					  lp->fid,
-					  lp->dns_rp->port_id,
+					  FC_FID_DIR_SERV,
 					  FC_FC_SEQ_INIT | FC_FC_END_SEQ);
 	}
 	if (error || sp == NULL)
@@ -944,7 +944,7 @@ static void fc_ns_enter_reg_pn(struct fc_lport *lp)
 				  fc_ns_resp, NULL, lp,
 				  lp->e_d_tov,
 				  lp->fid,
-				  lp->dns_rp->port_id,
+				  FC_FID_DIR_SERV,
 				  FC_FC_SEQ_INIT | FC_FC_END_SEQ))
 		fc_ns_retry(lp);
 }
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index c0ebfcd..b8c2a55 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1379,7 +1379,7 @@ void fc_block_rports(struct fc_lport *lp)
 	spin_lock_irqsave(shost->host_lock, flags);
 	list_for_each_entry_safe(rport, next, &fc_host_rports(shost), peers) {
 		/* protect the name service remote port */
-		if (rport == lp->dns_rp)
+		if (rport->port_id == FC_FID_DIR_SERV)
 			continue;
 		if (rport->port_state != FC_PORTSTATE_ONLINE)
 			continue;




More information about the devel mailing list