git: 742c5498aca9 - main - bxe(4): don't feed a zero page size to ilog2 during ILT init
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 31 Aug 2026 23:19:00 UTC
The branch main has been updated by nprice:
URL: https://cgit.FreeBSD.org/src/commit/?id=742c5498aca9a9a31a68eb9d5888edf36b7034dd
commit 742c5498aca9a9a31a68eb9d5888edf36b7034dd
Author: Nick Price <nprice@FreeBSD.org>
AuthorDate: 2026-08-31 23:16:12 +0000
Commit: Nick Price <nprice@FreeBSD.org>
CommitDate: 2026-08-31 23:18:42 +0000
bxe(4): don't feed a zero page size to ilog2 during ILT init
FreeBSD's bxe hardwires CNIC_SUPPORT() to 0, so bxe_ilt_set_info()
never enters the block that initializes the SRC and TM ILT clients.
Those two clients are left zeroed (page_size 0, flags 0), yet
ecore_ilt_init_page_size() calls ecore_ilt_init_client_psz() for all
four clients unconditionally. For SRC and TM that evaluates
ILOG2(page_size >> 12), i.e. ilog2(0). On an INVARIANTS kernel ilog2()
asserts "ilog argument must be nonzero" and panics the machine the
first time the interface is brought up (bxe_init -> bxe_nic_load ->
bxe_init_hw -> ecore_ilt_init_page_size). On a non-INVARIANTS kernel
it silently programs a bogus page-size register instead.
Restore the else branch that upstream Linux bnx2x carries: when CNIC
is not supported, mark the SRC and TM clients with ILT_CLIENT_SKIP_INIT
and ILT_CLIENT_SKIP_MEM so ecore_ilt_init_client_psz() skips them.
Root-caused from a crash dump on a BCM57810 (device 0x168e): the ILT
clients showed CDU and QM populated and SRC and TM zeroed with no skip
flag set.
Reviewed by: adrian
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D58587
Signed-off-by: Nick Price <nprice@FreeBSD.org>
---
sys/dev/bxe/bxe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 3e7120a42a90..b6364c3909bb 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -5899,6 +5899,11 @@ bxe_ilt_set_info(struct bxe_softc *sc)
ilt_client->start, ilt_client->end,
ilt_client->page_size, ilt_client->flags,
ilog2(ilt_client->page_size >> 12));
+ } else {
+ ilt->clients[ILT_CLIENT_SRC].flags =
+ (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);
+ ilt->clients[ILT_CLIENT_TM].flags =
+ (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);
}
KASSERT((line <= ILT_MAX_LINES), ("Invalid number of ILT lines!"));