From a046bf0559018ba3d16c412fc4e1aa2be5f11f36 Mon Sep 17 00:00:00 2001 From: Krishna Gudipati Date: Wed, 3 Mar 2010 17:43:45 -0800 Subject: [SCSI] bfa: Fix to allow creation of only 190 vports on CNA. 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 Signed-off-by: James Bottomley --- drivers/scsi/bfa/bfa_lps.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/scsi/bfa/bfa_lps.c') diff --git a/drivers/scsi/bfa/bfa_lps.c b/drivers/scsi/bfa/bfa_lps.c index c8c2564af72..66b9b15f429 100644 --- a/drivers/scsi/bfa/bfa_lps.c +++ b/drivers/scsi/bfa/bfa_lps.c @@ -18,6 +18,7 @@ #include #include #include +#include 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 */ -- cgit v1.2.2