summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Winder <pwinder@racktopsystems.com>2020-12-09 10:30:59 +0000
committerPaul Winder <paul@winder.uk.net>2021-02-12 16:21:27 +0000
commit592b68f9130dc6c5b980b90fbb93d13a5a4c3265 (patch)
tree9cd942f36ab0f116075f21623c7200a7b60b77b0
parent99d0d3f582c9145a267ddfd9fef778459d415339 (diff)
downloadillumos-joyent-592b68f9130dc6c5b980b90fbb93d13a5a4c3265.tar.gz
13433 After cxgbe transceiver is reseated, link does not return to up state
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Andy Fiddaman <andy@omnios.org> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r--usr/src/uts/common/io/cxgbe/common/t4_hw.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/usr/src/uts/common/io/cxgbe/common/t4_hw.c b/usr/src/uts/common/io/cxgbe/common/t4_hw.c
index 4bb48f1b3a..82f7555945 100644
--- a/usr/src/uts/common/io/cxgbe/common/t4_hw.c
+++ b/usr/src/uts/common/io/cxgbe/common/t4_hw.c
@@ -9351,6 +9351,7 @@ void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl)
enum fw_port_module_type mod_type;
unsigned int speed, fc, fec;
fw_port_cap32_t pcaps, acaps, lpacaps, linkattr;
+ boolean_t fec_changed;
/*
* Extract the various fields from the Port Information message.
@@ -9452,8 +9453,11 @@ void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl)
t4_os_portmod_changed(adapter, pi->port_id);
}
+ fec_changed = fec != (lc->requested_fec == FEC_AUTO ?
+ lc->fec : lc->requested_fec);
if (link_ok != lc->link_ok || speed != lc->speed ||
- fc != lc->fc || fec != lc->fec) { /* something changed */
+ fc != lc->fc || fec_changed) {
+ /* something changed */
if (!link_ok && lc->link_ok) {
lc->link_down_rc = linkdnrc;
CH_WARN_RATELIMIT(adapter,
@@ -9464,6 +9468,13 @@ void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl)
lc->speed = speed;
lc->fc = fc;
lc->fec = fec;
+ if (fec_changed) {
+ /*
+ * If the fec is not as requested we need
+ * to save the l1 config.
+ */
+ lc->redo_l1cfg = B_TRUE;
+ }
lc->lpacaps = lpacaps;
lc->acaps = acaps & ADVERT_MASK;
@@ -9691,10 +9702,12 @@ static void init_link_config(struct link_config *lc, fw_port_cap32_t pcaps,
if (fec_supported(pcaps)) {
/*
- * For Forward Error Control, we default to whatever the Firmware
- * tells us the Link is currently advertising.
+ * For Forward Error Control, we default to whatever the
+ * Firmware tells us the Link is currently advertising.
+ * We also retain any overrides set.
*/
- lc->requested_fec = FEC_AUTO;
+ if (lc->requested_fec == 0)
+ lc->requested_fec = FEC_AUTO;
lc->fec = fwcap_to_cc_fec(lc->def_acaps);
} else {
lc->requested_fec = FEC_NONE;