Re: [PATCH] qed: iscsi: limit command queue array fill to the ramrod array size
From: Pengpeng Hou
Date: Thu Mar 26 2026 - 20:53:27 EST
Hi,
No, I do not think the existing feat_num-based check is sufficient here.
That check only verifies that num_queues does not exceed the iSCSI CQ
resources reported by the hardware:
p_params->num_queues <= p_hwfn->hw_info.feat_num[QED_ISCSI_CQ]
But the ramrod field being filled afterwards is a fixed-size array:
cq_cmdq_sb_num_arr[SCSI_MAX_NUM_OF_CMDQS]
and SCSI_MAX_NUM_OF_CMDQS is 64 in the current tree.
The in-tree qedi caller derives num_queues from the device-reported CQ
count and the online CPU count:
dev_info.num_cqs = FEAT_NUM(hwfn, QED_ISCSI_CQ)
num_queues = min(dev_info.num_cqs, num_online_cpus())
So the existing resource check and the ramrod array capacity are not the
same bound. If the hardware reports more than 64 iSCSI CQs, current-tree
callers can still pass a num_queues value that satisfies the feat_num
check but exceeds ARRAY_SIZE(cq_cmdq_sb_num_arr).
I can resend with this clarified in the commit message.
Best regards,
Pengpeng