Skip to content

Commit 49f2bf1

Browse files
cp890582martinkpetersen
authored andcommitted
scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
RAID1 PCI bandwidth limit algorithm is not applicable to Aero as it's PCIe Gen4 adapter. Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Chandrakanth Patil <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a4413a5 commit 49f2bf1

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5777,6 +5777,9 @@ static int megasas_init_fw(struct megasas_instance *instance)
57775777
MR_MAX_RAID_MAP_SIZE_MASK);
57785778
}
57795779

5780+
if (instance->adapter_type == VENTURA_SERIES)
5781+
fusion->pcie_bw_limitation = true;
5782+
57805783
/* Check if MSI-X is supported while in ready state */
57815784
msix_enable = (instance->instancet->read_fw_status_reg(instance) &
57825785
0x4000000) >> 0x1a;

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,9 +2621,10 @@ static void megasas_stream_detect(struct megasas_instance *instance,
26212621
*
26222622
*/
26232623
static void
2624-
megasas_set_raidflag_cpu_affinity(union RAID_CONTEXT_UNION *praid_context,
2625-
struct MR_LD_RAID *raid, bool fp_possible,
2626-
u8 is_read, u32 scsi_buff_len)
2624+
megasas_set_raidflag_cpu_affinity(struct fusion_context *fusion,
2625+
union RAID_CONTEXT_UNION *praid_context,
2626+
struct MR_LD_RAID *raid, bool fp_possible,
2627+
u8 is_read, u32 scsi_buff_len)
26272628
{
26282629
u8 cpu_sel = MR_RAID_CTX_CPUSEL_0;
26292630
struct RAID_CONTEXT_G35 *rctx_g35;
@@ -2681,11 +2682,11 @@ megasas_set_raidflag_cpu_affinity(union RAID_CONTEXT_UNION *praid_context,
26812682
* vs MR_RAID_FLAGS_IO_SUB_TYPE_CACHE_BYPASS.
26822683
* IO Subtype is not bitmap.
26832684
*/
2684-
if ((raid->level == 1) && (!is_read)) {
2685-
if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE)
2686-
praid_context->raid_context_g35.raid_flags =
2687-
(MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT
2688-
<< MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT);
2685+
if ((fusion->pcie_bw_limitation) && (raid->level == 1) && (!is_read) &&
2686+
(scsi_buff_len > MR_LARGE_IO_MIN_SIZE)) {
2687+
praid_context->raid_context_g35.raid_flags =
2688+
(MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT
2689+
<< MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT);
26892690
}
26902691
}
26912692

@@ -2834,8 +2835,9 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
28342835
(instance->host->can_queue)) {
28352836
fp_possible = false;
28362837
atomic_dec(&instance->fw_outstanding);
2837-
} else if ((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) ||
2838-
(atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0)) {
2838+
} else if (fusion->pcie_bw_limitation &&
2839+
((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) ||
2840+
(atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0))) {
28392841
fp_possible = false;
28402842
atomic_dec(&instance->fw_outstanding);
28412843
if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE)
@@ -2860,7 +2862,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
28602862

28612863
/* If raid is NULL, set CPU affinity to default CPU0 */
28622864
if (raid)
2863-
megasas_set_raidflag_cpu_affinity(&io_request->RaidContext,
2865+
megasas_set_raidflag_cpu_affinity(fusion, &io_request->RaidContext,
28642866
raid, fp_possible, io_info.isRead,
28652867
scsi_buff_len);
28662868
else

drivers/scsi/megaraid/megaraid_sas_fusion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ struct fusion_context {
13351335
dma_addr_t ioc_init_request_phys;
13361336
struct MPI2_IOC_INIT_REQUEST *ioc_init_request;
13371337
struct megasas_cmd *ioc_init_cmd;
1338-
1338+
bool pcie_bw_limitation;
13391339
};
13401340

13411341
union desc_value {

0 commit comments

Comments
 (0)