cxgbe(4): meminfo should get the TLS region's limits from the hardware.

meminfo is meant for debugging and it should read hardware configuration
directly when possible instead of relying on values queried from the
firmware.  Rename the region to "TLSKey region" to match other drivers
while here.

MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2022-04-05 14:54:11 -07:00
parent 9983e5cce6
commit f88b31885c

View File

@ -9708,8 +9708,8 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS)
"Tx payload:", "Rx payload:", "LE hash:", "iSCSI region:",
"TDDP region:", "TPT region:", "STAG region:", "RQ region:",
"RQUDP region:", "PBL region:", "TXPBL region:",
"DBVFIFO region:", "ULPRX state:", "ULPTX state:",
"On-chip queues:", "TLS keys:",
"TLSKey region:", "DBVFIFO region:", "ULPRX state:",
"ULPTX state:", "On-chip queues:",
};
struct mem_desc avail[4];
struct mem_desc mem[nitems(region) + 3]; /* up to 3 holes */
@ -9824,6 +9824,8 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS)
ulp_region(RX_RQUDP);
ulp_region(RX_PBL);
ulp_region(TX_PBL);
if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS)
ulp_region(RX_TLS_KEY);
#undef ulp_region
md->base = 0;
@ -9862,13 +9864,6 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS)
md->idx = nitems(region); /* hide it */
md++;
md->base = sc->vres.key.start;
if (sc->vres.key.size)
md->limit = md->base + sc->vres.key.size - 1;
else
md->idx = nitems(region); /* hide it */
md++;
/* add any address-space holes, there can be up to 3 */
for (n = 0; n < i - 1; n++)
if (avail[n].limit < avail[n + 1].base)
@ -9877,6 +9872,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS)
(md++)->base = avail[n].limit;
n = md - mem;
MPASS(n <= nitems(mem));
qsort(mem, n, sizeof(struct mem_desc), mem_desc_cmp);
for (lo = 0; lo < i; lo++)