Commit 869c4d5e authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Improve stats context resource accounting with RDMA driver loaded.

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: c027c6b4 ("bnxt_en: get rid of num_stat_ctxs variable")
Reviewed-by: default avatarYongping Zhang <yongping.zhang@broadcom.com>
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2284bbd0
...@@ -222,8 +222,12 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp) ...@@ -222,8 +222,12 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp)
int bnxt_get_ulp_stat_ctxs(struct bnxt *bp) int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
{ {
if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) {
return BNXT_MIN_ROCE_STAT_CTXS; struct bnxt_en_dev *edev = bp->edev;
if (edev->ulp_tbl[BNXT_ROCE_ULP].msix_requested)
return BNXT_MIN_ROCE_STAT_CTXS;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment