From c29895544c71b77b1d4dc4eb0f0aa5ae4481ed3c Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Wed, 1 Oct 2014 17:09:31 -0400 Subject: [PATCH] megaraid_sas: Permit large RAID0/1 requests Orabug: 19625877 Allow max_sectors to be tuned to enable I/O request sizes of 1MB. This is not supported for RAID5/6 volumes but the UEK[23] kernels lack an infrastructure for communicating per-LUN request size limits. This has been remedied by upstream commit bcdb247c6b6a. In the meantime allow setting the max_sectors module parameter to 1MB for Invader and Fury cards. Signed-off-by: Kashyap Desai Signed-off-by: Martin K. Petersen Signed-off-by: Guangyu Sun (cherry picked from commit 54e01aad1ef694d7ec4026d2efb5c8d19f981513) Signed-off-by: Martin K. Petersen --- drivers/scsi/megaraid/megaraid_sas_base.c | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index a022c39153cf..8477fc282aa4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -64,7 +64,8 @@ static unsigned int max_sectors; module_param_named(max_sectors, max_sectors, int, 0); MODULE_PARM_DESC(max_sectors, - "Maximum number of sectors per IO command"); + "Maximum number of sectors per IO command." + "Used only for deployments where R5/R6 Volumes are not used."); static int msix_disable; module_param(msix_disable, int, S_IRUGO); @@ -5073,17 +5074,31 @@ static int megasas_io_attach(struct megasas_instance *instance) if (max_sectors && max_sectors < instance->max_sectors_per_req) instance->max_sectors_per_req = max_sectors; else { + /* The max_sectors module parameter permits increasing + * max sectors to 2048. Users should only use this + * parameter in configurations where R5/R6 Volumes are + * not being used. NOTE: This module parameter will + * enable driver to send 1M I/Os for R5/R6 volumes which + * may result in unexpected behavior. + */ if (max_sectors) { if (((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078GEN2) || (instance->pdev->device == - PCI_DEVICE_ID_LSI_SAS0079GEN2)) && + PCI_DEVICE_ID_LSI_SAS0079GEN2) || + (instance->pdev->device == + PCI_DEVICE_ID_LSI_INVADER) || + (instance->pdev->device == + PCI_DEVICE_ID_LSI_FURY)) && (max_sectors <= MEGASAS_MAX_SECTORS)) { instance->max_sectors_per_req = max_sectors; + dev_info(&instance->pdev->dev, + "max_sectors per request is set to %d\n", + instance->max_sectors_per_req); } else { - printk(KERN_INFO "megasas: max_sectors should be > 0" - "and <= %d (or < 1MB for GEN2 controller)\n", - instance->max_sectors_per_req); + dev_warn(&instance->pdev->dev, " max_sectors should be > 0 and" + "<= %d (or < 1MB for supported controllers)\n", + instance->max_sectors_per_req); } } } -- 2.50.1