Skip to contentSkip to conversation

RDMA/irdma: Cap MSIX used to online CPUs + 1

PATCH Superseded Sindhu Devale 2 participants 2 messages Feb 2, 2023 – Feb 6, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: Cap MSIX used to online CPUs + 1

From: Mustafa Ismail <[email protected]>

The irdma driver can use a maximum number of msix vectors equal to num_online_cpus() + 1 and the Kernel warning stack below is shown if that number is exceeded. The kernel throws a warning as the driver tries to update the affinity hint with a CPU mask greater than the max CPU IDs. Fix this by capping the MSIX vectors to num_online_cpus() + 1.

kernel: WARNING: CPU: 7 PID: 23655 at include/linux/cpumask.h:106 irdma_cfg_ceq_vector+0x34c/0x3f0 [irdma]
kernel: RIP: 0010:irdma_cfg_ceq_vector+0x34c/0x3f0 [irdma]
kernel: Call Trace:
kernel: irdma_rt_init_hw+0xa62/0x1290 [irdma]

Fixes 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions")
---
 drivers/infiniband/hw/irdma/hw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/irdma/hw.c +2 -0
index ab246447520b..2e1e2bad0401 100644
@@ -483,6 +483,8 @@ static int irdma_save_msix_info(struct irdma_pci_f *rf)
 	iw_qvlist->num_vectors = rf->msix_count;
 	if (rf->msix_count <= num_online_cpus())
 		rf->msix_shared = true;
+	else if (rf->msix_count > num_online_cpus() + 1)
+		rf->msix_count = num_online_cpus() + 1;
 
 	pmsix = rf->msix_entries;
 	for (i = 0, ceq_idx = 0; i < rf->msix_count; i++, iw_qvinfo++) {
Signature · 1 line
2.27.0
#1 lore raw
Quoted 4 lines · Sindhu Devale

From: Mustafa Ismail <[email protected]>

The irdma driver can use a maximum number of msix vectors equal to num_online_cpus() + 1 and the Kernel

kernel

Quoted 4 lines

warning stack below is shown if that number is exceeded. The kernel throws a warning as the driver tries to update the affinity hint with a CPU mask greater than the max CPU IDs. Fix this by capping the MSIX vectors to num_online_cpus() + 1.

You shouldn't squeeze your commit message to 60 chars, please don't break lines like this.

Quoted 5 lines

kernel: WARNING: CPU: 7 PID: 23655 at include/linux/cpumask.h:106 irdma_cfg_ceq_vector+0x34c/0x3f0 [irdma]
kernel: RIP: 0010:irdma_cfg_ceq_vector+0x34c/0x3f0 [irdma]
kernel: Call Trace:
kernel: irdma_rt_init_hw+0xa62/0x1290 [irdma]

Please provide full kernel splat and not truncated version.

Quoted 25 lines
Fixes 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions")
---
 drivers/infiniband/hw/irdma/hw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/irdma/hw.c +2 -0
index ab246447520b..2e1e2bad0401 100644
@@ -483,6 +483,8 @@ static int irdma_save_msix_info(struct irdma_pci_f *rf)
 	iw_qvlist->num_vectors = rf->msix_count;
 	if (rf->msix_count <= num_online_cpus())
 		rf->msix_shared = true;
+	else if (rf->msix_count > num_online_cpus() + 1)
+		rf->msix_count = num_online_cpus() + 1;
 
 	pmsix = rf->msix_entries;
 	for (i = 0, ceq_idx = 0; i < rf->msix_count; i++, iw_qvinfo++) {
Signature · 1 line
2.27.0