summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid/megaraid_sas_fusion.c
diff options
context:
space:
mode:
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>2018-01-05 05:33:04 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-22 20:03:58 -0500
commitf870bcbe9a991264f424ad937916695b2f3de133 (patch)
tree16163eb80a1f3a3fa111aa9b10426d0760bf6b0f /drivers/scsi/megaraid/megaraid_sas_fusion.c
parentb45093dd76bed88ac72330c08338ea329c94d20c (diff)
scsi: megaraid_sas: NVMe passthrough command support
NVMe passthrough via MFI interface. Current MegaRAID product supports different types of encapsulation via the MFI framework. NVMe native command should be framed by application and it should be embedded in MFI as payload. The driver will provide interface to send the MFI frame along with the payload (in this case, payload is NVMe native command) to the firmware. Driver already has an existing, similar interface for SATA and SMP passthrough. 1. Driver will pass MFI command to the firmware if the latter supports NVMe encapsulated processing (not all SAS3.5 firmware supports this feature). 2. Driver exposes sysfs entry support_nvme_encapsulation. This is required for backward compatibility for applications using earlier driver versions that did not process IOCTL frames and could result in host hang. This is already fixed as part of commit 82add4e1b354 ("scsi: megaraid_sas: Incorrect processing of IOCTL frames for SMP/STP commands") [mkp: clarified commit message] Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas_fusion.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 97fae28c8374..073ced07e662 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1079,6 +1079,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
drv_ops->mfi_capabilities.support_qd_throttling = 1;
drv_ops->mfi_capabilities.support_pd_map_target_id = 1;
+ drv_ops->mfi_capabilities.support_nvme_passthru = 1;
if (instance->consistent_mask_64bit)
drv_ops->mfi_capabilities.support_64bit_mode = 1;
@@ -3993,7 +3994,13 @@ void megasas_refire_mgmt_cmd(struct megasas_instance *instance)
result = RETURN_CMD;
break;
+ case MFI_CMD_NVME:
+ if (!instance->support_nvme_passthru) {
+ cmd_mfi->frame->hdr.cmd_status = MFI_STAT_INVALID_CMD;
+ result = COMPLETE_CMD;
+ }
+ break;
default:
break;
}