diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2022-01-05 18:45:06 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2022-01-05 19:15:34 +0000 |
commit | f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46 (patch) | |
tree | f82c3dae6408c35706785ec726ee351ce2919cac | |
parent | 9e007a88d65ba0d23e73c3c052d474a78260d503 (diff) | |
download | src-f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46.tar.gz src-f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46.zip |
cxgbe(4): Do not request an FEC that is invalid for the requested speed.
This eliminates error messages like this from the driver when running at
50Gbps with 100G cables:
[3726] cc0: l1cfg failed: 71
[4407] cc0: l1cfg failed: 71
Note that link comes up anyway with or without this change.
Reported by: Suhas Lokesha @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications
-rw-r--r-- | sys/dev/cxgbe/common/t4_hw.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index d65d69075e88..c60594596959 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3924,6 +3924,9 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, if (speed & FW_PORT_CAP32_SPEED_100G) { fec |= FW_PORT_CAP32_FEC_RS; fec |= FW_PORT_CAP32_FEC_NO_FEC; + } else if (speed & FW_PORT_CAP32_SPEED_50G) { + fec |= FW_PORT_CAP32_FEC_BASER_RS; + fec |= FW_PORT_CAP32_FEC_NO_FEC; } else { fec |= FW_PORT_CAP32_FEC_RS; fec |= FW_PORT_CAP32_FEC_BASER_RS; @@ -3937,6 +3940,19 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, * because we aren't setting FORCE_FEC here. */ fec |= fec_to_fwcap(lc->fec_hint); + MPASS(powerof2(fec)); + + /* + * Override the hint if the FEC is not valid for + * the potential top speed. Request the best + * FEC at that speed instead. + */ + if (speed & FW_PORT_CAP32_SPEED_100G && + fec == FW_PORT_CAP32_FEC_BASER_RS) + fec = FW_PORT_CAP32_FEC_RS; + else if (speed & FW_PORT_CAP32_SPEED_50G && + fec == FW_PORT_CAP32_FEC_RS) + fec = FW_PORT_CAP32_FEC_BASER_RS; } } else { /* |