Bug 286720 - Broadcom bnxt driver store_cfg bug fixed
Summary: Broadcom bnxt driver store_cfg bug fixed
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.3-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-11 08:15 UTC by liangyi571
Modified: 2025-09-30 15:24 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description liangyi571 2025-05-11 08:15:06 UTC
In bnxt_hwrm.c, at the end of function bnxt_hwrm_func_backing_store_cfg, return hwrm_send_message(softc, &req, sizeof(req)). This will cause my P2100G initial failed, because some adapter message size should under 256 bytes while sizeof(req) is over 256 bytes. In the beginning of bnxt_hwrm_func_backing_store_cfg, req_len is limited to 256, but the author forget to set it while call hwrm_send_message.

So the correct code will be:

hwrm_send_message(softc, &req, req_len)

717c717
<       return hwrm_send_message(softc, &req, sizeof(req));
---
>       return hwrm_send_message(softc, &req, req_len);
Comment 1 Zhenlei Huang freebsd_committer freebsd_triage 2025-05-12 01:33:47 UTC
It appears to be a mistake. CC Chandrakanth patil .
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2025-05-23 17:02:12 UTC
I posted the patch here, thanks: https://reviews.freebsd.org/D50491

To be clear: this patch is sufficient to fix initialization of your card?
Comment 3 Zhenlei Huang freebsd_committer freebsd_triage 2025-09-11 02:00:46 UTC
(In reply to liangyi571 from comment #0)
Hi, can you confirm the patch works for you ? 15.0-RELEASE is coming, I think it is better to fix it before the release.
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-09-11 16:09:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5ca390f03bc63bccc8952313d536fd4bcabf2cab

commit 5ca390f03bc63bccc8952313d536fd4bcabf2cab
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-09-11 14:36:00 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-09-11 16:08:05 +0000

    bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg()

    PR:             286720
    Reviewed by:    zlei
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D50491

 sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-09-21 14:53:41 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=20bb3d7d500bae255d0c52ebacb32502616f490d

commit 20bb3d7d500bae255d0c52ebacb32502616f490d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-09-11 14:36:00 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-09-21 14:52:38 +0000

    bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg()

    PR:             286720
    Reviewed by:    zlei
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D50491

    (cherry picked from commit 5ca390f03bc63bccc8952313d536fd4bcabf2cab)

 sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 Mark Johnston freebsd_committer freebsd_triage 2025-09-21 15:13:48 UTC
Thank you for the patch.
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-09-30 15:24:30 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=87691082d86090ae3f7c7b2687468b535fb6367f

commit 87691082d86090ae3f7c7b2687468b535fb6367f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-09-11 14:36:00 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-09-30 09:43:07 +0000

    bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg()

    PR:             286720
    Reviewed by:    zlei
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D50491

    (cherry picked from commit 5ca390f03bc63bccc8952313d536fd4bcabf2cab)

 sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)