From nobody Wed Jan 05 19:23:49 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6D48219283D4; Wed, 5 Jan 2022 19:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JTfY20L7Pz4bCQ; Wed, 5 Jan 2022 19:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5F9912293; Wed, 5 Jan 2022 19:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 205JNnON057498; Wed, 5 Jan 2022 19:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 205JNn4i057497; Wed, 5 Jan 2022 19:23:49 GMT (envelope-from git) Date: Wed, 5 Jan 2022 19:23:49 GMT Message-Id: <202201051923.205JNn4i057497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f3c2987f2f5c - main - cxgbe(4): Do not request an FEC that is invalid for the requested speed. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641410630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVz4E8EfW9rEyr+idIKjE/D8CtditYQy2LqI1ZiLEw8=; b=b9PB0FGvCyQKj7uJ+F/QCKw9IJ7wB/sxNKzbhGik11nJwZAjP484QnliBRdgtuHbi6jdrk tRvtxTJkWPJhJRWl7H0IZgXMyxfTTvBUkCmNvMIWzUsLBJ7ysvh71AGwXqZvcxDZwX6pAt pinlO89uOCXF05fBE3lU/yXKEgaMlr3y4G/d0MZ0AiunYBn+oW/YWH31ze8T3XMelRnExg rcGH4+n6ExfKMasLT1spIczzA0PuVPn7/RJ0FXoFnr8+qcI68JP29eqxXVMkEs4pDfTZsn xe9J4dJQjk1FFUlCOLChfqtm9qQiIUuQdSK6j6ACnQr3q5u7POVrisM/TYByJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641410630; a=rsa-sha256; cv=none; b=xK/WF6MnumVXmjNgH6FG0TYWFVVOatw+OpztwvhcIs/kvHdCXH6nmNGCa7xPocg7ffdler pgXJLZliTADAJJ/3TEGKS9sH5v60QXaX29opl+oh1lC6dD5y9CpvOZRRaHWZdPkknoE/F8 x2ppEZN8EYAhc2atsDmfUY7EkIrBOB/gN3G/gb45qcK2gslHHwrHTz22oU/PgewXeouIO8 baMPnnNiKcbVR+wFnTBvEMWHzQeOJEosrtuaM24/rBf02ZfSAtkaeLExcH6x8IIq3K+nUs w6KbaxICuQ1aGlBxCW4RBIjEuc9A+V3O2u+SsG1MgdAVHINdUFtUkap7iT6gJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46 commit f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46 Author: Navdeep Parhar AuthorDate: 2022-01-05 18:45:06 +0000 Commit: Navdeep Parhar CommitDate: 2022-01-05 19:15:34 +0000 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 --- sys/dev/cxgbe/common/t4_hw.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 { /*