diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 19:51:28 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:04:10 -0500 |
commit | c507341713114e2510ad7621088b359367adf1ce (patch) | |
tree | bd4080a1f1ee37755b8edd61eda13a8b1bc35b42 /drivers/scsi/bfa/rport_api.c | |
parent | 7c8146510c9cacdaaeb273b5fef6b9201d933bc1 (diff) |
[SCSI] bfa: fix rport speed setting
When a rport goes offline, its speed setting was not reset. Subsequently, if
the rport was not deleted due to it coming back online within rport del
timeout, previously discovered speed would continue to show up. The fix is to
reset the speed when processing rport offline transition.
In rport attributes, rport's with unknown speed were indicated as TRL
enforced. The right thing do to would be to use TRL default speed to
determine if TRL is enforced, when TRL is enabled.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/rport_api.c')
-rw-r--r-- | drivers/scsi/bfa/rport_api.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/rport_api.c b/drivers/scsi/bfa/rport_api.c index a441f41d2a6..15e0c470afd 100644 --- a/drivers/scsi/bfa/rport_api.c +++ b/drivers/scsi/bfa/rport_api.c @@ -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)); @@ -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; } |