]> www.infradead.org Git - users/hch/configfs.git/commitdiff
bnxt_en: Remove unneeded MSIX base structure fields and code
authorVikas Gupta <vikas.gupta@broadcom.com>
Tue, 9 Apr 2024 21:54:27 +0000 (14:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Apr 2024 02:55:05 +0000 (19:55 -0700)
Ever since commit:

303432211324 ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h

index 795f3f957eb5e5ede9aba35032837185a80790f2..8213a37cba3e47ff0e6200011572e3736019ce47 100644 (file)
@@ -3905,13 +3905,12 @@ static int bnxt_alloc_cp_sub_ring(struct bnxt *bp,
 static int bnxt_alloc_cp_rings(struct bnxt *bp)
 {
        bool sh = !!(bp->flags & BNXT_FLAG_SHARED_RINGS);
-       int i, j, rc, ulp_base_vec, ulp_msix;
+       int i, j, rc, ulp_msix;
        int tcs = bp->num_tc;
 
        if (!tcs)
                tcs = 1;
        ulp_msix = bnxt_get_ulp_msix_num(bp);
-       ulp_base_vec = bnxt_get_ulp_msix_base(bp);
        for (i = 0, j = 0; i < bp->cp_nr_rings; i++) {
                struct bnxt_napi *bnapi = bp->bnapi[i];
                struct bnxt_cp_ring_info *cpr, *cpr2;
@@ -3930,10 +3929,7 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
                if (rc)
                        return rc;
 
-               if (ulp_msix && i >= ulp_base_vec)
-                       ring->map_idx = i + ulp_msix;
-               else
-                       ring->map_idx = i;
+               ring->map_idx = ulp_msix + i;
 
                if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS))
                        continue;
@@ -7347,17 +7343,7 @@ static int bnxt_hwrm_reserve_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
 
 int bnxt_nq_rings_in_use(struct bnxt *bp)
 {
-       int cp = bp->cp_nr_rings;
-       int ulp_msix, ulp_base;
-
-       ulp_msix = bnxt_get_ulp_msix_num(bp);
-       if (ulp_msix) {
-               ulp_base = bnxt_get_ulp_msix_base(bp);
-               cp += ulp_msix;
-               if ((ulp_base + ulp_msix) > cp)
-                       cp = ulp_base + ulp_msix;
-       }
-       return cp;
+       return bp->cp_nr_rings + bnxt_get_ulp_msix_num(bp);
 }
 
 static int bnxt_cp_rings_in_use(struct bnxt *bp)
@@ -7373,16 +7359,7 @@ static int bnxt_cp_rings_in_use(struct bnxt *bp)
 
 static int bnxt_get_func_stat_ctxs(struct bnxt *bp)
 {
-       int ulp_stat = bnxt_get_ulp_stat_ctxs(bp);
-       int cp = bp->cp_nr_rings;
-
-       if (!ulp_stat)
-               return cp;
-
-       if (bnxt_nq_rings_in_use(bp) > cp + bnxt_get_ulp_msix_num(bp))
-               return bnxt_get_ulp_msix_base(bp) + ulp_stat;
-
-       return cp + ulp_stat;
+       return bp->cp_nr_rings + bnxt_get_ulp_stat_ctxs(bp);
 }
 
 static int bnxt_get_total_rss_ctxs(struct bnxt *bp, struct bnxt_hw_rings *hwr)
index fd890819d4bcd64c2b71a6a7374beaad2fb24da9..cae88747b1101aa003332ee1a592fbb2df1331a1 100644 (file)
@@ -31,21 +31,20 @@ static DEFINE_IDA(bnxt_aux_dev_ids);
 static void bnxt_fill_msix_vecs(struct bnxt *bp, struct bnxt_msix_entry *ent)
 {
        struct bnxt_en_dev *edev = bp->edev;
-       int num_msix, idx, i;
+       int num_msix, i;
 
        if (!edev->ulp_tbl->msix_requested) {
                netdev_warn(bp->dev, "Requested MSI-X vectors insufficient\n");
                return;
        }
        num_msix = edev->ulp_tbl->msix_requested;
-       idx = edev->ulp_tbl->msix_base;
        for (i = 0; i < num_msix; i++) {
-               ent[i].vector = bp->irq_tbl[idx + i].vector;
-               ent[i].ring_idx = idx + i;
+               ent[i].vector = bp->irq_tbl[i].vector;
+               ent[i].ring_idx = i;
                if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
                        ent[i].db_offset = bp->db_offset;
                else
-                       ent[i].db_offset = (idx + i) * 0x80;
+                       ent[i].db_offset = i * 0x80;
        }
 }
 
@@ -111,17 +110,6 @@ int bnxt_get_ulp_msix_num(struct bnxt *bp)
                min_t(u32, roce_msix, num_online_cpus()) : 0);
 }
 
-int bnxt_get_ulp_msix_base(struct bnxt *bp)
-{
-       if (bnxt_ulp_registered(bp->edev)) {
-               struct bnxt_en_dev *edev = bp->edev;
-
-               if (edev->ulp_tbl->msix_requested)
-                       return edev->ulp_tbl->msix_base;
-       }
-       return 0;
-}
-
 int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
 {
        if (bnxt_ulp_registered(bp->edev)) {
index b9e73de14b5721ab21ffd68d7ca3343f83eb3323..f8df4095399fab532c2d1e4a0082dcf2bc2e9028 100644 (file)
@@ -46,7 +46,6 @@ struct bnxt_ulp {
        unsigned long   *async_events_bmap;
        u16             max_async_event_id;
        u16             msix_requested;
-       u16             msix_base;
        atomic_t        ref_count;
 };
 
@@ -96,7 +95,6 @@ static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev)
 }
 
 int bnxt_get_ulp_msix_num(struct bnxt *bp);
-int bnxt_get_ulp_msix_base(struct bnxt *bp);
 int bnxt_get_ulp_stat_ctxs(struct bnxt *bp);
 void bnxt_ulp_stop(struct bnxt *bp);
 void bnxt_ulp_start(struct bnxt *bp, int err);