scsi: lpfc: Fix incorrect request len mbox field when setting trunking via sysfs
authorJustin Tee <justin.tee@broadcom.com>
Fri, 28 Jun 2024 17:20:09 +0000 (10:20 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 5 Jul 2024 03:24:51 +0000 (23:24 -0400)
commitf65f31ac120bd2c308bf16b18e5ee74445c06446
tree01fe7ea67617ac228fcf5f85b0d695824062f9f6
parentede596b1434b57c0b3fd5c02b326efe5c54f6e48
scsi: lpfc: Fix incorrect request len mbox field when setting trunking via sysfs

When setting trunk modes through sysfs, the SLI_CONFIG mailbox command's
command payload length is incorrectly hardcoded to 12 bytes.  SLI_CONFIG's
payload length field should be specified large enough to encompass both the
submailbox command header and the submailbox request itself.

Thus, replace the hardcoded 12 bytes with a clearer calculation by way of
sizeof(struct lpfc_mbx_set_trunk_mode) - sizeof(struct lpfc_sli4_cfg_mhdr).

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240628172011.25921-7-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_attr.c