aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyrel Datwyler <[email protected]>2023-09-21 17:54:27 -0500
committerMartin K. Petersen <[email protected]>2023-09-21 22:14:20 -0400
commitb27bce7291e688738c7ed47f300c877c11cef2dc (patch)
treef519b89ca68e5002331ded650a42c4bb381e3141
parente1a4e0d3ce3b24421c25b7c335f0b7b948fd0c7f (diff)
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Brian King <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 6d66a416c44e..2bfeeb9ace01 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -6261,7 +6261,8 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
struct Scsi_Host *shost;
struct device *dev = &vdev->dev;
int rc = -ENOMEM;
- unsigned int max_scsi_queues = IBMVFC_MAX_SCSI_QUEUES;
+ unsigned int online_cpus = num_online_cpus();
+ unsigned int max_scsi_queues = min((unsigned int)IBMVFC_MAX_SCSI_QUEUES, online_cpus);
ENTER;
shost = scsi_host_alloc(&driver_template, sizeof(*vhost));