lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACKFLinpX_pC-rge6g+yU86rx-nnXaTQqXBEpwHAkZbbpdG68w@mail.gmail.com>
Date: Wed, 1 May 2024 23:19:48 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: David Wei <dw@...idwei.uk>
Cc: netdev@...r.kernel.org, Pavan Chebbi <pavan.chebbi@...adcom.com>, 
	Andy Gospodarek <andrew.gospodarek@...adcom.com>, Jakub Kicinski <kuba@...nel.org>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v1] bnxt: fix bnxt_get_avail_msix() returning
 negative values

On Thu, Apr 25, 2024 at 2:26 PM David Wei <dw@...idwei.uk> wrote:
>
> 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.
>
> Comparing with a newer chipset e.g. Thor and the codepath for
> BNXT_NEW_RM, I believe the intent is for bnxt_get_avail_msix() to always
> return >= 0. Fix the issue by using max().

Historically, MSIX vectors were requested by the RoCE driver during
run-time and we used bnxt_get_avail_msix() for this purpose.  Today,
RoCE MSIX vectors are statically set aside.  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() should also be
simplified to handle the BNXT_NEW_RM() case only.  I think that's the
most correct fix.  Thanks.

>
> Alternatively, perhaps __bnxt_reserve_rings() should be reverted back.
> But there may be paths calling into it where bnxt_get_avail_msix()
> returns a positive integer.
>

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ