Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204197
b: refs/heads/master
c: c507341
h: refs/heads/master
i:
  204195: b2faaa2
v: v3
  • Loading branch information
Jing Huang authored and James Bottomley committed Jul 27, 2010
1 parent a392557 commit 990ee7d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 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: 7c8146510c9cacdaaeb273b5fef6b9201d933bc1
refs/heads/master: c507341713114e2510ad7621088b359367adf1ce
30 changes: 21 additions & 9 deletions trunk/drivers/scsi/bfa/lport_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ bfa_fcs_port_get_rports(struct bfa_fcs_port_s *port, wwn_t rport_wwns[],
/*
* Iterate's through all the rport's in the given port to
* determine the maximum operating speed.
*
* To be used in TRL Functionality only
*/
enum bfa_pport_speed
bfa_fcs_port_get_rport_max_speed(struct bfa_fcs_port_s *port)
Expand All @@ -146,7 +148,8 @@ bfa_fcs_port_get_rport_max_speed(struct bfa_fcs_port_s *port)
struct bfa_fcs_s *fcs;
enum bfa_pport_speed max_speed = 0;
struct bfa_pport_attr_s pport_attr;
enum bfa_pport_speed pport_speed;
enum bfa_pport_speed pport_speed, rport_speed;
bfa_boolean_t trl_enabled = bfa_fcport_is_ratelim(port->fcs->bfa);

if (port == NULL)
return 0;
Expand All @@ -164,19 +167,28 @@ bfa_fcs_port_get_rport_max_speed(struct bfa_fcs_port_s *port)
qe = bfa_q_first(qh);

while (qe != qh) {
rport = (struct bfa_fcs_rport_s *)qe;
if ((bfa_os_ntoh3b(rport->pid) > 0xFFF000)
|| (bfa_fcs_rport_get_state(rport) == BFA_RPORT_OFFLINE)) {
rport = (struct bfa_fcs_rport_s *) qe;
if ((bfa_os_ntoh3b(rport->pid) > 0xFFF000) ||
(bfa_fcs_rport_get_state(rport) ==
BFA_RPORT_OFFLINE)) {
qe = bfa_q_next(qe);
continue;
}

if ((rport->rpf.rpsc_speed == BFA_PPORT_SPEED_8GBPS)
|| (rport->rpf.rpsc_speed > pport_speed)) {
max_speed = rport->rpf.rpsc_speed;
rport_speed = rport->rpf.rpsc_speed;
if ((trl_enabled) && (rport_speed ==
BFA_PPORT_SPEED_UNKNOWN)) {
/* Use default ratelim speed setting */
rport_speed =
bfa_fcport_get_ratelim_speed(port->fcs->bfa);
}

if ((rport_speed == BFA_PPORT_SPEED_8GBPS) ||
(rport_speed > pport_speed)) {
max_speed = rport_speed;
break;
} else if (rport->rpf.rpsc_speed > max_speed) {
max_speed = rport->rpf.rpsc_speed;
} else if (rport_speed > max_speed) {
max_speed = rport_speed;
}

qe = bfa_q_next(qe);
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/scsi/bfa/rport_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
{
struct bfa_rport_qos_attr_s qos_attr;
struct bfa_fcs_port_s *port = rport->port;
enum bfa_pport_speed rport_speed = rport->rpf.rpsc_speed;

bfa_os_memset(rport_attr, 0, sizeof(struct bfa_rport_attr_s));

Expand All @@ -102,10 +103,14 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
rport_attr->qos_attr = qos_attr;

rport_attr->trl_enforced = BFA_FALSE;

if (bfa_fcport_is_ratelim(port->fcs->bfa)) {
if ((rport->rpf.rpsc_speed == BFA_PPORT_SPEED_UNKNOWN) ||
(rport->rpf.rpsc_speed <
bfa_fcs_port_get_rport_max_speed(port)))
if (rport_speed == BFA_PPORT_SPEED_UNKNOWN) {
/* Use default ratelim speed setting */
rport_speed =
bfa_fcport_get_ratelim_speed(rport->fcs->bfa);
}
if (rport_speed < bfa_fcs_port_get_rport_max_speed(port))
rport_attr->trl_enforced = BFA_TRUE;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/bfa/rport_ftrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ void bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport)
if (__fcs_min_cfg(rport->port->fcs))
return;

rport->rpf.rpsc_speed = 0;
bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_OFFLINE);
}

Expand Down

0 comments on commit 990ee7d

Please sign in to comment.