aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcs_lport.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2012-08-22 22:52:58 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:10:57 -0400
commit61ba43947e61dcda4af0993135a7268e4c0465b9 (patch)
tree36a176d07d0e23a51f94f03b2b1c505ca66df3c0 /drivers/scsi/bfa/bfa_fcs_lport.c
parentce7242b80278426a798c13ce96657690db9332d9 (diff)
[SCSI] bfa: Add support for max target ports discovery
- Changes to avoid discovering NPIV port as remote port by the other NPIV ports created on same physical port when all the NPIV ports are part of the same zone in a fabric. - Provided mechanism to support maximum number of target ports for a given initiator port (physical port + NPIV ports) irrespective of the way in which the initiator and target ports are zoned in the fabric. - Introduced module_parameter max_rport_logins to restrict number of remote ports discovery which includes target and initiator remote ports. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcs_lport.c')
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index d4a4d534843..3b75f6fb2de 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -4691,6 +4691,10 @@ bfa_fcs_lport_ns_process_gidft_pids(struct bfa_fcs_lport_s *port, u32 *pid_buf,
4691 struct fcgs_gidft_resp_s *gidft_entry; 4691 struct fcgs_gidft_resp_s *gidft_entry;
4692 struct bfa_fcs_rport_s *rport; 4692 struct bfa_fcs_rport_s *rport;
4693 u32 ii; 4693 u32 ii;
4694 struct bfa_fcs_fabric_s *fabric = port->fabric;
4695 struct bfa_fcs_vport_s *vport;
4696 struct list_head *qe;
4697 u8 found = 0;
4694 4698
4695 for (ii = 0; ii < n_pids; ii++) { 4699 for (ii = 0; ii < n_pids; ii++) {
4696 gidft_entry = (struct fcgs_gidft_resp_s *) &pid_buf[ii]; 4700 gidft_entry = (struct fcgs_gidft_resp_s *) &pid_buf[ii];
@@ -4699,6 +4703,29 @@ bfa_fcs_lport_ns_process_gidft_pids(struct bfa_fcs_lport_s *port, u32 *pid_buf,
4699 continue; 4703 continue;
4700 4704
4701 /* 4705 /*
4706 * Ignore PID if it is of base port
4707 * (Avoid vports discovering base port as remote port)
4708 */
4709 if (gidft_entry->pid == fabric->bport.pid)
4710 continue;
4711
4712 /*
4713 * Ignore PID if it is of vport created on the same base port
4714 * (Avoid vport discovering every other vport created on the
4715 * same port as remote port)
4716 */
4717 list_for_each(qe, &fabric->vport_q) {
4718 vport = (struct bfa_fcs_vport_s *) qe;
4719 if (vport->lport.pid == gidft_entry->pid)
4720 found = 1;
4721 }
4722
4723 if (found) {
4724 found = 0;
4725 continue;
4726 }
4727
4728 /*
4702 * Check if this rport already exists 4729 * Check if this rport already exists
4703 */ 4730 */
4704 rport = bfa_fcs_lport_get_rport_by_pid(port, gidft_entry->pid); 4731 rport = bfa_fcs_lport_get_rport_by_pid(port, gidft_entry->pid);
@@ -4765,7 +4792,8 @@ bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port)
4765 struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port); 4792 struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
4766 4793
4767 bfa_trc(port->fcs, port->pid); 4794 bfa_trc(port->fcs, port->pid);
4768 bfa_sm_send_event(ns, NSSM_EVENT_NS_QUERY); 4795 if (bfa_sm_cmp_state(ns, bfa_fcs_lport_ns_sm_online))
4796 bfa_sm_send_event(ns, NSSM_EVENT_NS_QUERY);
4769} 4797}
4770 4798
4771static void 4799static void
@@ -5183,10 +5211,26 @@ static void
5183bfa_fcs_lport_scn_portid_rscn(struct bfa_fcs_lport_s *port, u32 rpid) 5211bfa_fcs_lport_scn_portid_rscn(struct bfa_fcs_lport_s *port, u32 rpid)
5184{ 5212{
5185 struct bfa_fcs_rport_s *rport; 5213 struct bfa_fcs_rport_s *rport;
5214 struct bfa_fcs_fabric_s *fabric = port->fabric;
5215 struct bfa_fcs_vport_s *vport;
5216 struct list_head *qe;
5186 5217
5187 bfa_trc(port->fcs, rpid); 5218 bfa_trc(port->fcs, rpid);
5188 5219
5189 /* 5220 /*
5221 * Ignore PID if it is of base port or of vports created on the
5222 * same base port. It is to avoid vports discovering base port or
5223 * other vports created on same base port as remote port
5224 */
5225 if (rpid == fabric->bport.pid)
5226 return;
5227
5228 list_for_each(qe, &fabric->vport_q) {
5229 vport = (struct bfa_fcs_vport_s *) qe;
5230 if (vport->lport.pid == rpid)
5231 return;
5232 }
5233 /*
5190 * If this is an unknown device, then it just came online. 5234 * If this is an unknown device, then it just came online.
5191 * Otherwise let rport handle the RSCN event. 5235 * Otherwise let rport handle the RSCN event.
5192 */ 5236 */