]> git.dujemihanovic.xyz Git - linux.git/commitdiff
bnxt_en: Increase the number of MSIX vectors for RoCE device
authorMichael Chan <michael.chan@broadcom.com>
Mon, 9 Sep 2024 20:27:35 +0000 (13:27 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Sep 2024 01:42:45 +0000 (18:42 -0700)
If RocE is supported on the device, set the number of RoCE MSIX vectors
to the number of online CPUs + 1 and capped at these maximums:

VF: 2
NPAR: 5
PF: 64

For the PF, the maximum is now increased from the previous value
of 9 to get better performance for kernel applications.

Remove the unnecessary check for BNXT_FLAG_ROCE_CAP.
bnxt_set_dflt_ulp_msix() will only be called if the flag is set.

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240909202737.93852-2-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h

index b9e7d3e7b15d073ad5dd9986008165eebfacee04..fdd6356f21efb3c0c2e62c88f4895cc1a523c945 100644 (file)
@@ -176,11 +176,17 @@ EXPORT_SYMBOL(bnxt_unregister_dev);
 
 static int bnxt_set_dflt_ulp_msix(struct bnxt *bp)
 {
-       u32 roce_msix = BNXT_VF(bp) ?
-                       BNXT_MAX_VF_ROCE_MSIX : BNXT_MAX_ROCE_MSIX;
+       int roce_msix = BNXT_MAX_ROCE_MSIX;
 
-       return ((bp->flags & BNXT_FLAG_ROCE_CAP) ?
-               min_t(u32, roce_msix, num_online_cpus()) : 0);
+       if (BNXT_VF(bp))
+               roce_msix = BNXT_MAX_ROCE_MSIX_VF;
+       else if (bp->port_partition_type)
+               roce_msix = BNXT_MAX_ROCE_MSIX_NPAR_PF;
+
+       /* NQ MSIX vectors should match the number of CPUs plus 1 more for
+        * the CREQ MSIX, up to the default.
+        */
+       return min_t(int, roce_msix, num_online_cpus() + 1);
 }
 
 int bnxt_send_msg(struct bnxt_en_dev *edev,
index 4eafe6ec0abfad2c213b4c1601f0080637c87615..4f4914f5c84c912b5c579b5f2f71a89da617bc3b 100644 (file)
 
 #define BNXT_MIN_ROCE_CP_RINGS 2
 #define BNXT_MIN_ROCE_STAT_CTXS        1
-#define BNXT_MAX_ROCE_MSIX     9
-#define BNXT_MAX_VF_ROCE_MSIX  2
+
+#define BNXT_MAX_ROCE_MSIX_VF          2
+#define BNXT_MAX_ROCE_MSIX_NPAR_PF     5
+#define BNXT_MAX_ROCE_MSIX             64
 
 struct hwrm_async_event_cmpl;
 struct bnxt;