Skip to content

Commit 0c722ec

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Fix MSIX request logic for RDMA driver.
The logic needs to check both bp->total_irqs and the reserved IRQs in hw_resc->resv_irqs if applicable and see if both are enough to cover the L2 and RDMA requested vectors. The current code is only checking bp->total_irqs and can fail in some code paths, such as the TX timeout code path with the RDMA driver requesting vectors after recovery. In this code path, we have not reserved enough MSIX resources for the RDMA driver yet. Fixes: 75720e6 ("bnxt_en: Keep track of reserved IRQs.") Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 868afba commit 0c722ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
113113
{
114114
struct net_device *dev = edev->net;
115115
struct bnxt *bp = netdev_priv(dev);
116+
struct bnxt_hw_resc *hw_resc;
116117
int max_idx, max_cp_rings;
117118
int avail_msix, idx;
119+
int total_vecs;
118120
int rc = 0;
119121

120122
ASSERT_RTNL();
@@ -142,7 +144,10 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
142144
}
143145
edev->ulp_tbl[ulp_id].msix_base = idx;
144146
edev->ulp_tbl[ulp_id].msix_requested = avail_msix;
145-
if (bp->total_irqs < (idx + avail_msix)) {
147+
hw_resc = &bp->hw_resc;
148+
total_vecs = idx + avail_msix;
149+
if (bp->total_irqs < total_vecs ||
150+
(BNXT_NEW_RM(bp) && hw_resc->resv_irqs < total_vecs)) {
146151
if (netif_running(dev)) {
147152
bnxt_close_nic(bp, true, false);
148153
rc = bnxt_open_nic(bp, true, false);
@@ -156,7 +161,6 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
156161
}
157162

158163
if (BNXT_NEW_RM(bp)) {
159-
struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
160164
int resv_msix;
161165

162166
resv_msix = hw_resc->resv_irqs - bp->cp_nr_rings;

0 commit comments

Comments
 (0)