Re: [PATCH v2 30/33] ibmvfc: implement nvme-fc IO command submission callback

Tyrel Datwyler <[email protected]> Thu, 30 Jul 2026 16:17:30 -0700
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-kernel,org.ozlabs.lists.linuxppc-dev
Message-ID <[email protected]>
On 7/29/26 11:48 AM, Dave Marquardt wrote:
> Tyrel Datwyler <[email protected]> writes:
> 
>> diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> index 45c7bcf69201..bc975f632da2 100644
>> --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> @@ -1539,7 +1539,7 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
>>  
>>  	login_info->ostype = cpu_to_be32(IBMVFC_OS_LINUX);
>>  	login_info->max_dma_len = cpu_to_be64(max_sectors << 9);
>> -	login_info->max_payload = cpu_to_be32(sizeof(struct ibmvfc_fcp_cmd_iu));
>> +	login_info->max_payload = cpu_to_be32(sizeof(struct nvme_fc_cmd_iu));
> 
> Do you know that sizeof(struct nvme_fc_cmd_iu) >= sizeof(struct
> ibmvfc_fcp_cmd_iu) just by examination? I was wondering if using MAX()
> here might be less prone to future breakage if the structures change.
> 
> -Dave
> 

I confirmed at the time I wrote the code that a nvme_fc_cmd_iu is bigger. Off
the top of my head I believe and nvme fcp command IU is roughly three times
larger than a standard fcp command. I had considered wrapping them in a union
and doing the sizeof the union.

-Tyrel