From nobody Mon Feb 28 06:55:48 2022 X-Original-To: dev-commits-src-all@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 720A919D2A49; Mon, 28 Feb 2022 06:55:48 +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 4K6WP02Lfpz4Rr9; Mon, 28 Feb 2022 06:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646031348; 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=Gn65s0j1fhiTMiBcTPer1zREcztteauLLyFt4qhsH18=; b=OHWWcMPPvdP0cu38KFhlrAkbtLrO/t253v8a4iG66xVFMbfn5I22vwjf6Wla9BH53NNddw 9NVcGOIkXdB+GQdvbsLvkqCh/DXDLY1qSrFcLBSQfpwtevAqew49xAf+bEIP75MqoNVoqe iCNeKE3hYjUSNXftuNNJNftiiiOfR6xLjFIN3YOf7ErxWJJLGyidHZsCn2j5Y3PHFSfB5E 7X68VBaH4fzTw2GYJuZvaSBzD6LTYghbZj8mSc+12hkp+AyNCuWx5F8VLjmcTwWC4pyFCn Y+QIdy1lbJ2WCT9E8lET39TioFa+4qlQyu+AOv5oPwAHpLGySIlHMHhnFSB1Aw== 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 1CFE516F66; Mon, 28 Feb 2022 06:55:48 +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 21S6tm4E077891; Mon, 28 Feb 2022 06:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21S6tmKq077890; Mon, 28 Feb 2022 06:55:48 GMT (envelope-from git) Date: Mon, 28 Feb 2022 06:55:48 GMT Message-Id: <202202280655.21S6tmKq077890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 438b8352856a - stable/13 - cxgbe(4): Do not request an FEC that is invalid for the requested speed. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 438b8352856ad3bd5ef410f60a4dca47ec17cf7b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646031348; 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=Gn65s0j1fhiTMiBcTPer1zREcztteauLLyFt4qhsH18=; b=Dsc23jJ1DqquwH9oSYRn8NsXlj8Xj5JH42AQH7aIL/lUC+kXfjujt4YTqPKMOlLUiyp4FE uF1gJteOzoH6g17LVwKlwYfRyLRnsGEVq/WMOYvmSGBIWCwtUIuopKt5dlGtOj89RWrhHG HNWEq9COKYbxcMYmrCn4FJ8ur3ATALcFp14cRb85or1qXrrIZHH5g9oZ9M+bgS7GliArBD E/9APVZW+8kM1wsUzoGB7xAq4ky8IAHCdQgdPW2fIEpP+M552xEp08R2UJm7qSY/d2eMYO lvxGhOAE9gUNcq94L5B8mIRf+Zj+Vi8nt4DnDLP89pwSz6YP12JDCArH/oDgmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646031348; a=rsa-sha256; cv=none; b=hYQ2bDRK4cFQ5icVVGIA7BkmoRVMvol17O9li9M/8SlbxHGmFFq/bn2Fpy1mYSh4xdwrQE T5r37NlTT3BfJJqg/aez/bpxvloFq9gfEptfpU1JcuqPOX7rY9qE700zwesCYJWYyQQ7Pz Q/5pFXeONCs5nkQiqXyntELeJN6RTz7AJgENFb7aKigSqUx/Y/h2XGQz2kVQ0/dCH06Xqo 4co2xe+lMxqx/Ayy/A1plGCAcR3kLNn/bcnIKe+AUE8shbmTrYtl0UlV8GQUFSZ/J3+H23 GV9giY+SvMhnH/Xn82Z6DjShhYtZR5mgWLN3jQ/EQUXvNzK+tWcKPwbtF/h6vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=438b8352856ad3bd5ef410f60a4dca47ec17cf7b commit 438b8352856ad3bd5ef410f60a4dca47ec17cf7b Author: Navdeep Parhar AuthorDate: 2022-01-05 18:45:06 +0000 Commit: Navdeep Parhar CommitDate: 2022-02-28 06:48:49 +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 Sponsored by: Chelsio Communications (cherry picked from commit f3c2987f2f5c91f0801fa8bbf9e1bc09d91aeb46) --- 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 { /*