git: 37cb194b416e - stable/13 - cxgbe(4): Display the number of free PM pages and p-structs in meminfo.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 02 Feb 2023 07:39:25 UTC
The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=37cb194b416e50ba82a8336cf92bc56623f81246 commit 37cb194b416e50ba82a8336cf92bc56623f81246 Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2022-04-06 00:15:31 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> 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)