Skip to content

Commit f4e8961

Browse files
Vasundhara Volamdavem330
authored andcommitted
bnxt_en: Do not modify max_stat_ctxs after RDMA driver requests/frees stat_ctxs
Calling bnxt_set_max_func_stat_ctxs() to modify max stat_ctxs requested or freed by the RDMA driver is wrong. After introducing reservation of resources recently, the driver has to keep track of all stat_ctxs including the ones used by the RDMA driver. This will provide a better foundation for accurate accounting of the stat_ctxs. Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c027c6b commit f4e8961

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7035,11 +7035,6 @@ unsigned int bnxt_get_max_func_stat_ctxs(struct bnxt *bp)
70357035
return bp->hw_resc.max_stat_ctxs;
70367036
}
70377037

7038-
void bnxt_set_max_func_stat_ctxs(struct bnxt *bp, unsigned int max)
7039-
{
7040-
bp->hw_resc.max_stat_ctxs = max;
7041-
}
7042-
70437038
unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp)
70447039
{
70457040
return bp->hw_resc.max_cp_rings;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,6 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id);
16871687
int __bnxt_hwrm_get_tx_rings(struct bnxt *bp, u16 fid, int *tx_rings);
16881688
int bnxt_hwrm_set_coal(struct bnxt *);
16891689
unsigned int bnxt_get_max_func_stat_ctxs(struct bnxt *bp);
1690-
void bnxt_set_max_func_stat_ctxs(struct bnxt *bp, unsigned int max);
16911690
unsigned int bnxt_get_avail_stat_ctxs_for_en(struct bnxt *bp);
16921691
unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp);
16931692
unsigned int bnxt_get_avail_cp_rings_for_en(struct bnxt *bp);

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ static int bnxt_register_dev(struct bnxt_en_dev *edev, int ulp_id,
5050
if (max_stat_ctxs <= BNXT_MIN_ROCE_STAT_CTXS ||
5151
bp->cp_nr_rings == max_stat_ctxs)
5252
return -ENOMEM;
53-
bnxt_set_max_func_stat_ctxs(bp, max_stat_ctxs -
54-
BNXT_MIN_ROCE_STAT_CTXS);
5553
}
5654

5755
atomic_set(&ulp->ref_count, 0);
@@ -82,14 +80,9 @@ static int bnxt_unregister_dev(struct bnxt_en_dev *edev, int ulp_id)
8280
netdev_err(bp->dev, "ulp id %d not registered\n", ulp_id);
8381
return -EINVAL;
8482
}
85-
if (ulp_id == BNXT_ROCE_ULP) {
86-
unsigned int max_stat_ctxs;
83+
if (ulp_id == BNXT_ROCE_ULP && ulp->msix_requested)
84+
edev->en_ops->bnxt_free_msix(edev, ulp_id);
8785

88-
max_stat_ctxs = bnxt_get_max_func_stat_ctxs(bp);
89-
bnxt_set_max_func_stat_ctxs(bp, max_stat_ctxs + 1);
90-
if (ulp->msix_requested)
91-
edev->en_ops->bnxt_free_msix(edev, ulp_id);
92-
}
9386
if (ulp->max_async_event_id)
9487
bnxt_hwrm_func_rgtr_async_events(bp, NULL, 0);
9588

0 commit comments

Comments
 (0)