]> git.itanic.dy.fi Git - linux-stable/commit
bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 11 Jan 2021 09:26:39 +0000 (04:26 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:26:18 +0000 (18:26 +0100)
commite8c8d2319bd794e1abd06f1d3ff3d5e70c4a60b7
tree19299680d61bd1567512a1275cad4b3a8ce78eb2
parent3bcf35a7c05f2e734a1b04d1dee76067f1816a7e
bnxt_en: Improve stats context resource accounting with RDMA driver loaded.

commit 869c4d5eb1e6fbda66aa790c48bdb946d71494a0 upstream.

The function bnxt_get_ulp_stat_ctxs() does not count the stats contexts
used by the RDMA driver correctly when the RDMA driver is freeing the
MSIX vectors.  It assumes that if the RDMA driver is registered, the
additional stats contexts will be needed.  This is not true when the
RDMA driver is about to unregister and frees the MSIX vectors.

This slight error leads to over accouting of the stats contexts needed
after the RDMA driver has unloaded.  This will cause some firmware
warning and error messages in dmesg during subsequent config. changes
or ifdown/ifup.

Fix it by properly accouting for extra stats contexts only if the
RDMA driver is registered and MSIX vectors have been successfully
requested.

Fixes: c027c6b4e91f ("bnxt_en: get rid of num_stat_ctxs variable")
Reviewed-by: Yongping Zhang <yongping.zhang@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c