|
37 | 37 | #include <linux/poll.h>
|
38 | 38 | #include <linux/vmalloc.h>
|
39 | 39 | #include <linux/irq_poll.h>
|
| 40 | +#include <linux/blk-mq-pci.h> |
40 | 41 |
|
41 | 42 | #include <scsi/scsi.h>
|
42 | 43 | #include <scsi/scsi_cmnd.h>
|
@@ -113,6 +114,10 @@ unsigned int enable_sdev_max_qd;
|
113 | 114 | module_param(enable_sdev_max_qd, int, 0444);
|
114 | 115 | MODULE_PARM_DESC(enable_sdev_max_qd, "Enable sdev max qd as can_queue. Default: 0");
|
115 | 116 |
|
| 117 | +int host_tagset_enable = 1; |
| 118 | +module_param(host_tagset_enable, int, 0444); |
| 119 | +MODULE_PARM_DESC(host_tagset_enable, "Shared host tagset enable/disable Default: enable(1)"); |
| 120 | + |
116 | 121 | MODULE_LICENSE("GPL");
|
117 | 122 | MODULE_VERSION(MEGASAS_VERSION);
|
118 | 123 | MODULE_AUTHOR( "[email protected]");
|
@@ -3119,6 +3124,19 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
|
3119 | 3124 | return 0;
|
3120 | 3125 | }
|
3121 | 3126 |
|
| 3127 | +static int megasas_map_queues(struct Scsi_Host *shost) |
| 3128 | +{ |
| 3129 | + struct megasas_instance *instance; |
| 3130 | + |
| 3131 | + instance = (struct megasas_instance *)shost->hostdata; |
| 3132 | + |
| 3133 | + if (shost->nr_hw_queues == 1) |
| 3134 | + return 0; |
| 3135 | + |
| 3136 | + return blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT], |
| 3137 | + instance->pdev, instance->low_latency_index_start); |
| 3138 | +} |
| 3139 | + |
3122 | 3140 | static void megasas_aen_polling(struct work_struct *work);
|
3123 | 3141 |
|
3124 | 3142 | /**
|
@@ -3427,6 +3445,7 @@ static struct scsi_host_template megasas_template = {
|
3427 | 3445 | .eh_timed_out = megasas_reset_timer,
|
3428 | 3446 | .shost_attrs = megaraid_host_attrs,
|
3429 | 3447 | .bios_param = megasas_bios_param,
|
| 3448 | + .map_queues = megasas_map_queues, |
3430 | 3449 | .change_queue_depth = scsi_change_queue_depth,
|
3431 | 3450 | .max_segment_size = 0xffffffff,
|
3432 | 3451 | };
|
@@ -6808,6 +6827,26 @@ static int megasas_io_attach(struct megasas_instance *instance)
|
6808 | 6827 | host->max_lun = MEGASAS_MAX_LUN;
|
6809 | 6828 | host->max_cmd_len = 16;
|
6810 | 6829 |
|
| 6830 | + /* Use shared host tagset only for fusion adaptors |
| 6831 | + * if there are managed interrupts (smp affinity enabled case). |
| 6832 | + * Single msix_vectors in kdump, so shared host tag is also disabled. |
| 6833 | + */ |
| 6834 | + |
| 6835 | + host->host_tagset = 0; |
| 6836 | + host->nr_hw_queues = 1; |
| 6837 | + |
| 6838 | + if ((instance->adapter_type != MFI_SERIES) && |
| 6839 | + (instance->msix_vectors > instance->low_latency_index_start) && |
| 6840 | + host_tagset_enable && |
| 6841 | + instance->smp_affinity_enable) { |
| 6842 | + host->host_tagset = 1; |
| 6843 | + host->nr_hw_queues = instance->msix_vectors - |
| 6844 | + instance->low_latency_index_start; |
| 6845 | + } |
| 6846 | + |
| 6847 | + dev_info(&instance->pdev->dev, |
| 6848 | + "Max firmware commands: %d shared with nr_hw_queues = %d\n", |
| 6849 | + instance->max_fw_cmds, host->nr_hw_queues); |
6811 | 6850 | /*
|
6812 | 6851 | * Notify the mid-layer about the new controller
|
6813 | 6852 | */
|
|
0 commit comments