Skip to content

Commit f775cb1

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Increase the number of MSIX vectors for RoCE device
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 <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 955f5b1 commit f775cb1

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,17 @@ EXPORT_SYMBOL(bnxt_unregister_dev);
176176

177177
static int bnxt_set_dflt_ulp_msix(struct bnxt *bp)
178178
{
179-
u32 roce_msix = BNXT_VF(bp) ?
180-
BNXT_MAX_VF_ROCE_MSIX : BNXT_MAX_ROCE_MSIX;
179+
int roce_msix = BNXT_MAX_ROCE_MSIX;
181180

182-
return ((bp->flags & BNXT_FLAG_ROCE_CAP) ?
183-
min_t(u32, roce_msix, num_online_cpus()) : 0);
181+
if (BNXT_VF(bp))
182+
roce_msix = BNXT_MAX_ROCE_MSIX_VF;
183+
else if (bp->port_partition_type)
184+
roce_msix = BNXT_MAX_ROCE_MSIX_NPAR_PF;
185+
186+
/* NQ MSIX vectors should match the number of CPUs plus 1 more for
187+
* the CREQ MSIX, up to the default.
188+
*/
189+
return min_t(int, roce_msix, num_online_cpus() + 1);
184190
}
185191

186192
int bnxt_send_msg(struct bnxt_en_dev *edev,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515

1616
#define BNXT_MIN_ROCE_CP_RINGS 2
1717
#define BNXT_MIN_ROCE_STAT_CTXS 1
18-
#define BNXT_MAX_ROCE_MSIX 9
19-
#define BNXT_MAX_VF_ROCE_MSIX 2
18+
19+
#define BNXT_MAX_ROCE_MSIX_VF 2
20+
#define BNXT_MAX_ROCE_MSIX_NPAR_PF 5
21+
#define BNXT_MAX_ROCE_MSIX 64
2022

2123
struct hwrm_async_event_cmpl;
2224
struct bnxt;

0 commit comments

Comments
 (0)