Skip to content

Commit b58f5a9

Browse files
vikasbrcmkuba-moo
authored andcommitted
bnxt_en: Remove unneeded MSIX base structure fields and code
Ever since commit: 3034322 ("bnxt_en: Remove runtime interrupt vector allocation") The MSIX base vector is effectively always 0. Remove all unneeded structure fields and code referencing the MSIX base. Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com> Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20240409215431.41424-4-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 43226dc commit b58f5a9

File tree

3 files changed

+8
-45
lines changed

3 files changed

+8
-45
lines changed

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

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3905,13 +3905,12 @@ static int bnxt_alloc_cp_sub_ring(struct bnxt *bp,
39053905
static int bnxt_alloc_cp_rings(struct bnxt *bp)
39063906
{
39073907
bool sh = !!(bp->flags & BNXT_FLAG_SHARED_RINGS);
3908-
int i, j, rc, ulp_base_vec, ulp_msix;
3908+
int i, j, rc, ulp_msix;
39093909
int tcs = bp->num_tc;
39103910

39113911
if (!tcs)
39123912
tcs = 1;
39133913
ulp_msix = bnxt_get_ulp_msix_num(bp);
3914-
ulp_base_vec = bnxt_get_ulp_msix_base(bp);
39153914
for (i = 0, j = 0; i < bp->cp_nr_rings; i++) {
39163915
struct bnxt_napi *bnapi = bp->bnapi[i];
39173916
struct bnxt_cp_ring_info *cpr, *cpr2;
@@ -3930,10 +3929,7 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
39303929
if (rc)
39313930
return rc;
39323931

3933-
if (ulp_msix && i >= ulp_base_vec)
3934-
ring->map_idx = i + ulp_msix;
3935-
else
3936-
ring->map_idx = i;
3932+
ring->map_idx = ulp_msix + i;
39373933

39383934
if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS))
39393935
continue;
@@ -7347,17 +7343,7 @@ static int bnxt_hwrm_reserve_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
73477343

73487344
int bnxt_nq_rings_in_use(struct bnxt *bp)
73497345
{
7350-
int cp = bp->cp_nr_rings;
7351-
int ulp_msix, ulp_base;
7352-
7353-
ulp_msix = bnxt_get_ulp_msix_num(bp);
7354-
if (ulp_msix) {
7355-
ulp_base = bnxt_get_ulp_msix_base(bp);
7356-
cp += ulp_msix;
7357-
if ((ulp_base + ulp_msix) > cp)
7358-
cp = ulp_base + ulp_msix;
7359-
}
7360-
return cp;
7346+
return bp->cp_nr_rings + bnxt_get_ulp_msix_num(bp);
73617347
}
73627348

73637349
static int bnxt_cp_rings_in_use(struct bnxt *bp)
@@ -7373,16 +7359,7 @@ static int bnxt_cp_rings_in_use(struct bnxt *bp)
73737359

73747360
static int bnxt_get_func_stat_ctxs(struct bnxt *bp)
73757361
{
7376-
int ulp_stat = bnxt_get_ulp_stat_ctxs(bp);
7377-
int cp = bp->cp_nr_rings;
7378-
7379-
if (!ulp_stat)
7380-
return cp;
7381-
7382-
if (bnxt_nq_rings_in_use(bp) > cp + bnxt_get_ulp_msix_num(bp))
7383-
return bnxt_get_ulp_msix_base(bp) + ulp_stat;
7384-
7385-
return cp + ulp_stat;
7362+
return bp->cp_nr_rings + bnxt_get_ulp_stat_ctxs(bp);
73867363
}
73877364

73887365
static int bnxt_get_total_rss_ctxs(struct bnxt *bp, struct bnxt_hw_rings *hwr)

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,20 @@ static DEFINE_IDA(bnxt_aux_dev_ids);
3131
static void bnxt_fill_msix_vecs(struct bnxt *bp, struct bnxt_msix_entry *ent)
3232
{
3333
struct bnxt_en_dev *edev = bp->edev;
34-
int num_msix, idx, i;
34+
int num_msix, i;
3535

3636
if (!edev->ulp_tbl->msix_requested) {
3737
netdev_warn(bp->dev, "Requested MSI-X vectors insufficient\n");
3838
return;
3939
}
4040
num_msix = edev->ulp_tbl->msix_requested;
41-
idx = edev->ulp_tbl->msix_base;
4241
for (i = 0; i < num_msix; i++) {
43-
ent[i].vector = bp->irq_tbl[idx + i].vector;
44-
ent[i].ring_idx = idx + i;
42+
ent[i].vector = bp->irq_tbl[i].vector;
43+
ent[i].ring_idx = i;
4544
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
4645
ent[i].db_offset = bp->db_offset;
4746
else
48-
ent[i].db_offset = (idx + i) * 0x80;
47+
ent[i].db_offset = i * 0x80;
4948
}
5049
}
5150

@@ -111,17 +110,6 @@ int bnxt_get_ulp_msix_num(struct bnxt *bp)
111110
min_t(u32, roce_msix, num_online_cpus()) : 0);
112111
}
113112

114-
int bnxt_get_ulp_msix_base(struct bnxt *bp)
115-
{
116-
if (bnxt_ulp_registered(bp->edev)) {
117-
struct bnxt_en_dev *edev = bp->edev;
118-
119-
if (edev->ulp_tbl->msix_requested)
120-
return edev->ulp_tbl->msix_base;
121-
}
122-
return 0;
123-
}
124-
125113
int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
126114
{
127115
if (bnxt_ulp_registered(bp->edev)) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct bnxt_ulp {
4646
unsigned long *async_events_bmap;
4747
u16 max_async_event_id;
4848
u16 msix_requested;
49-
u16 msix_base;
5049
atomic_t ref_count;
5150
};
5251

@@ -96,7 +95,6 @@ static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev)
9695
}
9796

9897
int bnxt_get_ulp_msix_num(struct bnxt *bp);
99-
int bnxt_get_ulp_msix_base(struct bnxt *bp);
10098
int bnxt_get_ulp_stat_ctxs(struct bnxt *bp);
10199
void bnxt_ulp_stop(struct bnxt *bp);
102100
void bnxt_ulp_start(struct bnxt *bp, int err);

0 commit comments

Comments
 (0)