]> Pileus Git - ~andy/linux/commitdiff
[SCSI] bfa: Fix to allow creation of only 190 vports on CNA.
authorKrishna Gudipati <kgudipat@brocade.com>
Thu, 4 Mar 2010 01:43:45 +0000 (17:43 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 4 Mar 2010 10:45:24 +0000 (16:15 +0530)
Brocade CNA currently supports only 190 vports (instead of 191),
since there are only 192 unicast cam entries reserved for FCoE.

Brocade CNA has a total of 256 unicast cam entries (192 FCoE + 64 LL)

192 cam entries = 1 burned in mac + 1 baseport FPMA mac + 190 vport
FPMA macs.

Made changes to the code to support only 190 vports.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bfa/bfa_lps.c
drivers/scsi/bfa/fcs_vport.h
drivers/scsi/bfa/include/bfa_svc.h
drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h
drivers/scsi/bfa/lport_api.c
drivers/scsi/bfa/vport.c

index c8c2564af72507fed7ecaad60804e876b826392a..66b9b15f42943a4046485c4c8d767eb6f2cbe250 100644 (file)
@@ -18,6 +18,7 @@
 #include <bfa.h>
 #include <bfi/bfi_lps.h>
 #include <cs/bfa_debug.h>
+#include <defs/bfa_defs_pci.h>
 
 BFA_TRC_FILE(HAL, LPS);
 BFA_MODULE(lps);
@@ -25,6 +26,12 @@ BFA_MODULE(lps);
 #define BFA_LPS_MIN_LPORTS     (1)
 #define BFA_LPS_MAX_LPORTS     (256)
 
+/*
+ * Maximum Vports supported per physical port or vf.
+ */
+#define BFA_LPS_MAX_VPORTS_SUPP_CB  255
+#define BFA_LPS_MAX_VPORTS_SUPP_CT  190
+
 /**
  * forward declarations
  */
@@ -598,6 +605,19 @@ bfa_lps_cvl_event(struct bfa_lps_s *lps)
                bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
 }
 
+u32
+bfa_lps_get_max_vport(struct bfa_s *bfa)
+{
+       struct bfa_ioc_attr_s ioc_attr;
+
+       bfa_get_attr(bfa, &ioc_attr);
+
+       if (ioc_attr.pci_attr.device_id == BFA_PCI_DEVICE_ID_CT)
+               return (BFA_LPS_MAX_VPORTS_SUPP_CT);
+       else
+               return (BFA_LPS_MAX_VPORTS_SUPP_CB);
+}
+
 /**
  *  lps_public BFA LPS public functions
  */
index 32565ba666eb774cb100e1ed4369f05b0648e892..13c32ebf946ca54ba7226e1304c093699e9d2586 100644 (file)
@@ -26,7 +26,6 @@ void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
-u32 bfa_fcs_vport_get_max(struct bfa_fcs_s *fcs);
 
 #endif /* __FCS_VPORT_H__ */
 
index 2e4372f66b8b951c14a042c9c694e06f979ab090..0d7ed4d963a724a1e84b0bd3fa1fa9c90d4538ea 100644 (file)
@@ -293,6 +293,7 @@ void bfa_uf_free(struct bfa_uf_s *uf);
  * bfa lport service api
  */
 
+u32    bfa_lps_get_max_vport(struct bfa_s *bfa);
 struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa);
 void bfa_lps_delete(struct bfa_lps_s *lps);
 void bfa_lps_discard(struct bfa_lps_s *lps);
index 967ceb0eb074881d4f6877597a70f040d68fb632..ceaefd3060f4553a4c05c6707a8ad7aa4001a166 100644 (file)
@@ -34,14 +34,6 @@ struct bfa_fcs_s;
 struct bfa_fcs_fabric_s;
 
 /*
-* @todo : need to move to a global config file.
- * Maximum Vports supported per physical port or vf.
- */
-#define BFA_FCS_MAX_VPORTS_SUPP_CB  255
-#define BFA_FCS_MAX_VPORTS_SUPP_CT  191
-
-/*
-* @todo : need to move to a global config file.
  * Maximum Rports supported per port (physical/logical).
  */
 #define BFA_FCS_MAX_RPORTS_SUPP  256   /* @todo : tentative value */
index 1e06792cd4c2cea68f4ec1a56a5497fe6e93eed4..4a4ccce9936417de41761454e5ea8bcc4feb7061 100644 (file)
@@ -235,7 +235,8 @@ bfa_fcs_port_get_info(struct bfa_fcs_port_s *port,
                port_info->port_wwn = bfa_fcs_port_get_pwwn(port);
                port_info->node_wwn = bfa_fcs_port_get_nwwn(port);
 
-               port_info->max_vports_supp = bfa_fcs_vport_get_max(port->fcs);
+               port_info->max_vports_supp =
+                       bfa_lps_get_max_vport(port->fcs->bfa);
                port_info->num_vports_inuse =
                        bfa_fcs_fabric_vport_count(port->fabric);
                port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP;
index 75d6f058a4617c27e99e689a7fd519fbd53c3348..3dce9e1c947dd238d7b3a9720d7062da04c10dcd 100644 (file)
@@ -616,21 +616,6 @@ bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport)
        bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELCOMP);
 }
 
-u32
-bfa_fcs_vport_get_max(struct bfa_fcs_s *fcs)
-{
-       struct bfa_ioc_attr_s ioc_attr;
-
-       bfa_get_attr(fcs->bfa, &ioc_attr);
-
-       if (ioc_attr.pci_attr.device_id == BFA_PCI_DEVICE_ID_CT)
-               return BFA_FCS_MAX_VPORTS_SUPP_CT;
-       else
-               return BFA_FCS_MAX_VPORTS_SUPP_CB;
-}
-
-
-
 /**
  *  fcs_vport_api Virtual port API
  */
@@ -667,7 +652,7 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs,
                return BFA_STATUS_VPORT_EXISTS;
 
        if (bfa_fcs_fabric_vport_count(&fcs->fabric) ==
-           bfa_fcs_vport_get_max(fcs))
+               bfa_lps_get_max_vport(fcs->bfa))
                return BFA_STATUS_VPORT_MAX;
 
        vport->lps = bfa_lps_alloc(fcs->bfa);