Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188326
b: refs/heads/master
c: a046bf0
h: refs/heads/master
v: v3
  • Loading branch information
Krishna Gudipati authored and James Bottomley committed Mar 4, 2010
1 parent c6553a1 commit 926fabc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82794a2e4153657d12a0c29272e40b47eaadb748
refs/heads/master: a046bf0559018ba3d16c412fc4e1aa2be5f11f36
20 changes: 20 additions & 0 deletions trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 926fabc

Please sign in to comment.