Skip to content

Commit 30f5294

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.
Calling bnxt_set_max_func_irqs() to modify the max IRQ count requested or freed by the RDMA driver is flawed. The max IRQ count is checked when re-initializing the IRQ vectors and this can happen multiple times during ifup or ethtool -L. If the max IRQ is reduced and the RDMA driver is operational, we may not initailize IRQs correctly. This problem shows up on VFs with very small number of MSIX. There is no other logic that relies on the IRQ count excluding the ones used by RDMA. So we fix it by just removing the call to subtract or add the IRQs used by RDMA. Fixes: a588e45 ("bnxt_en: Add interface to support RDMA driver.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 30e3384 commit 30f5294

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5919,7 +5919,7 @@ unsigned int bnxt_get_max_func_irqs(struct bnxt *bp)
59195919
return min_t(unsigned int, hw_resc->max_irqs, hw_resc->max_cp_rings);
59205920
}
59215921

5922-
void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
5922+
static void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
59235923
{
59245924
bp->hw_resc.max_irqs = max_irqs;
59255925
}

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,6 @@ void bnxt_set_max_func_stat_ctxs(struct bnxt *bp, unsigned int max);
14701470
unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp);
14711471
void bnxt_set_max_func_cp_rings(struct bnxt *bp, unsigned int max);
14721472
unsigned int bnxt_get_max_func_irqs(struct bnxt *bp);
1473-
void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max);
14741473
int bnxt_get_avail_msix(struct bnxt *bp, int num);
14751474
int bnxt_reserve_rings(struct bnxt *bp);
14761475
void bnxt_tx_disable(struct bnxt *bp);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
169169
edev->ulp_tbl[ulp_id].msix_requested = avail_msix;
170170
}
171171
bnxt_fill_msix_vecs(bp, ent);
172-
bnxt_set_max_func_irqs(bp, bnxt_get_max_func_irqs(bp) - avail_msix);
173172
bnxt_set_max_func_cp_rings(bp, max_cp_rings - avail_msix);
174173
edev->flags |= BNXT_EN_FLAG_MSIX_REQUESTED;
175174
return avail_msix;
@@ -192,7 +191,6 @@ static int bnxt_free_msix_vecs(struct bnxt_en_dev *edev, int ulp_id)
192191
msix_requested = edev->ulp_tbl[ulp_id].msix_requested;
193192
bnxt_set_max_func_cp_rings(bp, max_cp_rings + msix_requested);
194193
edev->ulp_tbl[ulp_id].msix_requested = 0;
195-
bnxt_set_max_func_irqs(bp, bnxt_get_max_func_irqs(bp) + msix_requested);
196194
edev->flags &= ~BNXT_EN_FLAG_MSIX_REQUESTED;
197195
if (netif_running(dev)) {
198196
bnxt_close_nic(bp, true, false);

0 commit comments

Comments
 (0)