scsi: megaraid_sas: add correct return type check for ldio hint logic for raid1
Return value check of atomic_dec_if_positive is required as it returns old value minus one. Without this fix, driver will send small ios to firmware path and that will be a performance issue. Not critical, but good to have r1_ldio_hint as default value in sdev private. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
64ff64b90e
commit
49524b3c6e
|
@ -1963,6 +1963,9 @@ scan_target:
|
|||
if (!mr_device_priv_data)
|
||||
return -ENOMEM;
|
||||
sdev->hostdata = mr_device_priv_data;
|
||||
|
||||
atomic_set(&mr_device_priv_data->r1_ldio_hint,
|
||||
instance->r1_ldio_hint_default);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2338,7 +2338,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
|
|||
fp_possible = false;
|
||||
atomic_dec(&instance->fw_outstanding);
|
||||
} else if ((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) ||
|
||||
atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint)) {
|
||||
(atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0)) {
|
||||
fp_possible = false;
|
||||
atomic_dec(&instance->fw_outstanding);
|
||||
if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE)
|
||||
|
|
Loading…
Reference in a new issue