From nobody Thu Feb 02 07:39:25 2023 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 4P6rJs4MSgz3c8gF; Thu, 2 Feb 2023 07:39:25 +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 4P6rJs3db7z4QZZ; Thu, 2 Feb 2023 07:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323565; 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=wcsxm2lUgoAIxpx+oDP7XeQxyumAR4RgD2g1j7HvhKM=; b=x158XCWCDlh6KLm4Xe49qA8QyLHc8R8b90SMlSdw8sCQpiBUrM3GyNH/Wf7Cd3Nb11t7+N QC6Fkr0CTB/UWL3PpP/6ZUP0swOPSwb8jjq9+/JjWslJLDM63Ch7WAv8CZqcc/sKEp/WkD /hrjz1i6t2kGum5UjJtBxLQenfT33nfC3q1up2jq6H5UkvSZrE8UVPRKOjn9ApIN3y1/u5 pL+hQtRPfFrRXe7YsboleP9WU2DciizJwaodMZMTANNj288xbZhAxJ7wheDKz1Csi3BU36 Vj87vPSajfUd+hU4thZyd1cTc1lE6KsRNKCnIxFMtqjKGPakobDtXf1S864vVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323565; 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=wcsxm2lUgoAIxpx+oDP7XeQxyumAR4RgD2g1j7HvhKM=; b=si36Ap7GHgmwBPA8ia7trcwKIOySR0fWd67ZDmPxKS5bBxZCNZzFi4GraDYpajOdQw3/to sGI+79N/2n9oqpR1LMFVpb943SjJTeWWyFZ4juZR1A03Uswvy0Pm3Vy0cQQkDc/EwJlE0b O3D98jfhZW9mu/RRPEfy/89BhiEpEyPdiYkSPGpP0hc41yVwRzvPbO0gy25wy06q1g4T+i dQJUs6VdCg+b54u/c4Jfl9RbnTCTB7md+H2ZqtJ+1GRlziZot0w+KjUAvQXpdyhttVjIGp k5g4+ckPI2P+HkmLcu8NVc+Xjk7inpqt62LSeGFqNmjgXVK8qkQ1YIGGj55DAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675323565; a=rsa-sha256; cv=none; b=bPF6/50Hywn7dtO1ABqN2JYNwuJENL7obYN1Sbr9pk/DxZrABT95CQovRQd/1uD9EwlgFv Cn41OuNFTsWSLYK2V+IXn8seIEcYUvBUnmgu7++bihwA6Ud6GKP5TNqUc0z+Yhxou0zVaF bC89KlDInlZk3xm7W2q0B/ZAnT7i8kQVrFDDK/ghE68PGAcxv4Rix5kSfjfXC3cE+OjsRI 8jeVS2J34j/7umSMvW53L97G41oqyBQ65Uy3D2S46O3dxfqa6ccWryOsP6Me2Isj9TC/WD p04axZ5TtdFfThSc8PgBLR2l+GO9xrBTyeNj741izA0xkcPjg4haH+dYLmcedw== 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 4P6rJs2lHkzm4s; Thu, 2 Feb 2023 07:39:25 +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 3127dPkO061876; Thu, 2 Feb 2023 07:39:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3127dPYg061875; Thu, 2 Feb 2023 07:39:25 GMT (envelope-from git) Date: Thu, 2 Feb 2023 07:39:25 GMT Message-Id: <202302020739.3127dPYg061875@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: 37cb194b416e - stable/13 - cxgbe(4): Display the number of free PM pages and p-structs in meminfo. 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: 37cb194b416e50ba82a8336cf92bc56623f81246 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=37cb194b416e50ba82a8336cf92bc56623f81246 commit 37cb194b416e50ba82a8336cf92bc56623f81246 Author: Navdeep Parhar AuthorDate: 2022-04-06 00:15:31 +0000 Commit: Navdeep Parhar CommitDate: 2023-02-02 07:11:17 +0000 cxgbe(4): Display the number of free PM pages and p-structs in meminfo. Sponsored by: Chelsio Communications (cherry picked from commit c5a7885c80260f5eccb616ecbc77d7e919ce2614) --- sys/dev/cxgbe/t4_main.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 32348d3c4b8c..fd98cdc76299 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -9851,7 +9851,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) struct adapter *sc = arg1; struct sbuf *sb; int rc, i, n; - uint32_t lo, hi, used, alloc; + uint32_t lo, hi, used, free, alloc; static const char *memory[] = { "EDC0:", "EDC1:", "MC:", "MC0:", "MC1:", "HMA:" }; @@ -10052,19 +10052,24 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) mem_region_show(sb, "uP Extmem2:", lo, hi); lo = t4_read_reg(sc, A_TP_PMM_RX_MAX_PAGE); - sbuf_printf(sb, "\n%u Rx pages of size %uKiB for %u channels\n", - G_PMRXMAXPAGE(lo), + for (i = 0, free = 0; i < 2; i++) + free += G_FREERXPAGECOUNT(t4_read_reg(sc, A_TP_FLM_FREE_RX_CNT)); + sbuf_printf(sb, "\n%u Rx pages (%u free) of size %uKiB for %u channels\n", + G_PMRXMAXPAGE(lo), free, t4_read_reg(sc, A_TP_PMM_RX_PAGE_SIZE) >> 10, (lo & F_PMRXNUMCHN) ? 2 : 1); lo = t4_read_reg(sc, A_TP_PMM_TX_MAX_PAGE); hi = t4_read_reg(sc, A_TP_PMM_TX_PAGE_SIZE); - sbuf_printf(sb, "%u Tx pages of size %u%ciB for %u channels\n", - G_PMTXMAXPAGE(lo), + for (i = 0, free = 0; i < 4; i++) + free += G_FREETXPAGECOUNT(t4_read_reg(sc, A_TP_FLM_FREE_TX_CNT)); + sbuf_printf(sb, "%u Tx pages (%u free) of size %u%ciB for %u channels\n", + G_PMTXMAXPAGE(lo), free, hi >= (1 << 20) ? (hi >> 20) : (hi >> 10), hi >= (1 << 20) ? 'M' : 'K', 1 << G_PMTXNUMCHN(lo)); - sbuf_printf(sb, "%u p-structs\n", - t4_read_reg(sc, A_TP_CMM_MM_MAX_PSTRUCT)); + sbuf_printf(sb, "%u p-structs (%u free)\n", + t4_read_reg(sc, A_TP_CMM_MM_MAX_PSTRUCT), + G_FREEPSTRUCTCOUNT(t4_read_reg(sc, A_TP_FLM_FREE_PS_CNT))); for (i = 0; i < 4; i++) { if (chip_id(sc) > CHELSIO_T5)