aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_ctl.c
diff options
context:
space:
mode:
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>2011-09-07 20:48:50 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-09-22 07:08:35 -0400
commit911ae9434f83e7355d343f6c2be3ef5b00ea7aed (patch)
tree3129ff0724f0ae65a7e23ab1addba47fb5c4b634 /drivers/scsi/mpt2sas/mpt2sas_ctl.c
parent66195fc9fad98e00abf2cd1a141bbcf0994daaf7 (diff)
[SCSI] mpt2sas: Added NUNA IO support in driver which uses multi-reply queue support of the HBA
Support added for controllers capable of multi reply queues. The following are the modifications to the driver to support NUMA. 1) Create the new structure adapter_reply_queue to contain the reply queue info for every msix vector. This object will contain a reply_post_host_index, reply_post_free for each instance, msix_index, among other parameters. We will track all the reply queues on a link list called ioc->reply_queue_list. Each reply queue is aligned with each IRQ, and is passed to the interrupt via the bus_id parameter. (2) The driver will figure out the msix_vector_count from the PCIe MSIX capabilities register instead of the IOC Facts->MaxMSIxVectors. This is because the firmware is not filling in this field until the driver has already registered MSIX support. (3) If the ioc_facts reports that the controller is MSIX compatible in the capabilities, then the driver will request for multiple irqs. This count is calculated based on the minimum between the online cpus available and the ioc->msix_vector_count. This count is reported to firmware in the ioc_init request. (4) New routines were added _base_free_irq and _base_request_irq, so registering and freeing msix vectors were done thru simple function API. (5) The new routine _base_assign_reply_queues was added to align the msix indexes across cpus. This will initialize the array called ioc->cpu_msix_table. This array is looked up on every MPI request so the MSIxIndex is set appropriately. (6) A new shost sysfs attribute was added to report the reply_queue_count. (7) User needs to set the affinity cpu mask, so the interrupts occur on the same cpu that sent the original request. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_ctl.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index 38ed0260959d..bf70f95f19ce 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -2705,6 +2705,33 @@ _ctl_ioc_reset_count_show(struct device *cdev, struct device_attribute *attr,
2705static DEVICE_ATTR(ioc_reset_count, S_IRUGO, 2705static DEVICE_ATTR(ioc_reset_count, S_IRUGO,
2706 _ctl_ioc_reset_count_show, NULL); 2706 _ctl_ioc_reset_count_show, NULL);
2707 2707
2708/**
2709 * _ctl_ioc_reply_queue_count_show - number of reply queues
2710 * @cdev - pointer to embedded class device
2711 * @buf - the buffer returned
2712 *
2713 * This is number of reply queues
2714 *
2715 * A sysfs 'read-only' shost attribute.
2716 */
2717static ssize_t
2718_ctl_ioc_reply_queue_count_show(struct device *cdev,
2719 struct device_attribute *attr, char *buf)
2720{
2721 u8 reply_queue_count;
2722 struct Scsi_Host *shost = class_to_shost(cdev);
2723 struct MPT2SAS_ADAPTER *ioc = shost_priv(shost);
2724
2725 if ((ioc->facts.IOCCapabilities &
2726 MPI2_IOCFACTS_CAPABILITY_MSI_X_INDEX) && ioc->msix_enable)
2727 reply_queue_count = ioc->reply_queue_count;
2728 else
2729 reply_queue_count = 1;
2730 return snprintf(buf, PAGE_SIZE, "%d\n", reply_queue_count);
2731}
2732static DEVICE_ATTR(reply_queue_count, S_IRUGO,
2733 _ctl_ioc_reply_queue_count_show, NULL);
2734
2708struct DIAG_BUFFER_START { 2735struct DIAG_BUFFER_START {
2709 __le32 Size; 2736 __le32 Size;
2710 __le32 DiagVersion; 2737 __le32 DiagVersion;
@@ -2915,6 +2942,7 @@ struct device_attribute *mpt2sas_host_attrs[] = {
2915 &dev_attr_host_trace_buffer_size, 2942 &dev_attr_host_trace_buffer_size,
2916 &dev_attr_host_trace_buffer, 2943 &dev_attr_host_trace_buffer,
2917 &dev_attr_host_trace_buffer_enable, 2944 &dev_attr_host_trace_buffer_enable,
2945 &dev_attr_reply_queue_count,
2918 NULL, 2946 NULL,
2919}; 2947};
2920 2948