aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/bfa/lport_api.c30
-rw-r--r--drivers/scsi/bfa/rport_api.c11
-rw-r--r--drivers/scsi/bfa/rport_ftrs.c1
3 files changed, 30 insertions, 12 deletions
diff --git a/drivers/scsi/bfa/lport_api.c b/drivers/scsi/bfa/lport_api.c
index d3907d184e2b..72b3f508d0e9 100644
--- a/drivers/scsi/bfa/lport_api.c
+++ b/drivers/scsi/bfa/lport_api.c
@@ -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)
@@ -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;
@@ -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);
diff --git a/drivers/scsi/bfa/rport_api.c b/drivers/scsi/bfa/rport_api.c
index a441f41d2a64..15e0c470afd9 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;
}
diff --git a/drivers/scsi/bfa/rport_ftrs.c b/drivers/scsi/bfa/rport_ftrs.c
index acecab83f82f..f2a9361ce9a4 100644
--- a/drivers/scsi/bfa/rport_ftrs.c
+++ b/drivers/scsi/bfa/rport_ftrs.c
@@ -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);
}