Skip to content

Commit b27bce7

Browse files
tyreldmartinkpetersen
authored andcommitted
scsi: ibmvfc: Limit max hw queues by num_online_cpus()
An LPAR could potentially be configured with a small logical cpu count that is less then the default hardware queue max. Ensure that we don't allocate more hw queues than available cpus. Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com> Link: https://lore.kernel.org/r/20230921225435.3537728-4-tyreld@linux.ibm.com Reviewed-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent e1a4e0d commit b27bce7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/scsi/ibmvscsi/ibmvfc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6261,7 +6261,8 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
62616261
struct Scsi_Host *shost;
62626262
struct device *dev = &vdev->dev;
62636263
int rc = -ENOMEM;
6264-
unsigned int max_scsi_queues = IBMVFC_MAX_SCSI_QUEUES;
6264+
unsigned int online_cpus = num_online_cpus();
6265+
unsigned int max_scsi_queues = min((unsigned int)IBMVFC_MAX_SCSI_QUEUES, online_cpus);
62656266

62666267
ENTER;
62676268
shost = scsi_host_alloc(&driver_template, sizeof(*vhost));

0 commit comments

Comments
 (0)