Skip to content

Commit

Permalink
[SCSI] bfa: Fix to allow creation of only 190 vports on CNA.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Krishna Gudipati authored and James Bottomley committed Mar 4, 2010
1 parent 82794a2 commit a046bf0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
20 changes: 20 additions & 0 deletions drivers/scsi/bfa/bfa_lps.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@
#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);

#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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/bfa/fcs_vport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

1 change: 1 addition & 0 deletions drivers/scsi/bfa/include/bfa_svc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/bfa/lport_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 1 addition & 16 deletions drivers/scsi/bfa/vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a046bf0

Please sign in to comment.