From nobody Wed Nov 10 01:16:27 2021 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 68C80183CFFA; Wed, 10 Nov 2021 01:16:28 +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 4Hpn4C4f90z3G62; Wed, 10 Nov 2021 01:16:27 +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 58F83790B; Wed, 10 Nov 2021 01:16:27 +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 1AA1GRkF074043; Wed, 10 Nov 2021 01:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA1GR4L074042; Wed, 10 Nov 2021 01:16:27 GMT (envelope-from git) Date: Wed, 10 Nov 2021 01:16:27 GMT Message-Id: <202111100116.1AA1GR4L074042@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: d99b1d83b9e9 - main - cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver. 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: d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd commit d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd Author: Navdeep Parhar AuthorDate: 2021-11-03 18:00:44 +0000 Commit: Navdeep Parhar CommitDate: 2021-11-09 23:41:20 +0000 cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver. dev...rcaps # sysctl dev.cc | grep rcaps dev.cc.1.rcaps: 581107776 dev.cc.0.rcaps: 582156414 MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 1 + sys/dev/cxgbe/t4_main.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 07d8ab2b40f0..50859e868b9d 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -444,6 +444,7 @@ struct link_config { int8_t requested_fc; /* flow control */ int8_t requested_fec; /* FEC */ u_int requested_speed; /* speed (Mbps) */ + uint32_t requested_caps;/* rcap in last l1cfg issued by the driver. */ uint32_t pcaps; /* link capabilities */ uint32_t acaps; /* advertised capabilities */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index f06b21120061..b9bf5df5ccc6 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3975,6 +3975,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, c.u.l1cfg.rcap = cpu_to_be32(fwcaps32_to_caps16(rcap)); } + lc->requested_caps = rcap; return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 66f48f2bf922..1c51e4847959 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5703,6 +5703,7 @@ init_link_config(struct port_info *pi) PORT_LOCK_ASSERT_OWNED(pi); + lc->requested_caps = 0; lc->requested_speed = 0; if (t4_autoneg == 0) @@ -7770,6 +7771,8 @@ cxgbe_sysctls(struct port_info *pi) sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rcaps", CTLFLAG_RD, + &pi->link_cfg.requested_caps, 0, "L1 config requested by driver"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcaps", CTLFLAG_RD, &pi->link_cfg.pcaps, 0, "port capabilities"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "acaps", CTLFLAG_RD,