Commit 5bfadc5
bnxt: fix bnxt_get_avail_msix() returning negative values
Current net-next/main does not boot for older chipsets e.g. Stratus.
Sample dmesg:
[ 11.368315] bnxt_en 0000:02:00.0 (unnamed net_device) (uninitialized): Able to reserve only 0 out of 9 requested RX rings
[ 11.390181] bnxt_en 0000:02:00.0 (unnamed net_device) (uninitialized): Unable to reserve tx rings
[ 11.438780] bnxt_en 0000:02:00.0 (unnamed net_device) (uninitialized): 2nd rings reservation failed.
[ 11.487559] bnxt_en 0000:02:00.0 (unnamed net_device) (uninitialized): Not enough rings available.
[ 11.506012] bnxt_en 0000:02:00.0: probe with driver bnxt_en failed with error -12
This is caused by bnxt_get_avail_msix() returning a negative value for
these chipsets not using the new resource manager i.e. !BNXT_NEW_RM.
This in turn causes hwr.cp in __bnxt_reserve_rings() to be set to 0.
In the current call stack, __bnxt_reserve_rings() is called from
bnxt_set_dflt_rings() before bnxt_init_int_mode(). Therefore,
bp->total_irqs is always 0 and for !BNXT_NEW_RM bnxt_get_avail_msix()
always returns a negative number.
Historically, MSIX vectors were requested by the RoCE driver during
run-time and bnxt_get_avail_msix() was used for this purpose. Today,
RoCE MSIX vectors are statically allocated. bnxt_get_avail_msix() should
only be called for the BNXT_NEW_RM() case to reserve the MSIX ahead of
time for RoCE use.
bnxt_get_avail_msix() is also be simplified to handle the BNXT_NEW_RM()
case only.
Fixes: d630624 ("bnxt_en: Utilize ulp client resources if RoCE is not registered")
Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20240502203757.3761827-1-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent c1742dc commit 5bfadc5
2 files changed
+5
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7469 | 7469 | | |
7470 | 7470 | | |
7471 | 7471 | | |
| 7472 | + | |
| 7473 | + | |
7472 | 7474 | | |
7473 | 7475 | | |
7474 | 7476 | | |
| |||
7481 | 7483 | | |
7482 | 7484 | | |
7483 | 7485 | | |
7484 | | - | |
| 7486 | + | |
7485 | 7487 | | |
7486 | 7488 | | |
7487 | 7489 | | |
| |||
10484 | 10486 | | |
10485 | 10487 | | |
10486 | 10488 | | |
10487 | | - | |
| 10489 | + | |
10488 | 10490 | | |
10489 | | - | |
10490 | 10491 | | |
10491 | 10492 | | |
10492 | | - | |
10493 | | - | |
10494 | | - | |
10495 | | - | |
10496 | | - | |
10497 | | - | |
10498 | | - | |
10499 | | - | |
10500 | 10493 | | |
10501 | 10494 | | |
10502 | 10495 | | |
| |||
10629 | 10622 | | |
10630 | 10623 | | |
10631 | 10624 | | |
10632 | | - | |
| 10625 | + | |
10633 | 10626 | | |
10634 | 10627 | | |
10635 | 10628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2738 | 2738 | | |
2739 | 2739 | | |
2740 | 2740 | | |
2741 | | - | |
2742 | 2741 | | |
2743 | 2742 | | |
2744 | 2743 | | |
| |||
0 commit comments