scsi: ibmvfc: Advertise client support for using hardware channels
authorTyrel Datwyler <tyreld@linux.ibm.com>
Thu, 14 Jan 2021 20:31:40 +0000 (14:31 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jan 2021 03:27:45 +0000 (22:27 -0500)
Previous patches have plumbed the necessary Sub-CRQ interface and channel
negotiation MADs to fully channelize via hardware backed queues.

Advertise client support via NPIV Login capability IBMVFC_CAN_USE_CHANNELS
when the client bits have MQ enabled via vhost->mq_enabled, or when
channels were already in use during a subsequent NPIV Login. The later is
required because channel support is only renegotiated after a CRQ pair is
broken. Simple NPIV Logout/Logins require the client to continue to
advertise the channel capability until the CRQ pair between the client is
broken.

Link: https://lore.kernel.org/r/20210114203148.246656-14-tyreld@linux.ibm.com
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c

index a8d3a34d98714e813c72b753985366f972e32fe0..31f0e55098d6d049a97fa0123170351a6072ee10 100644 (file)
@@ -1410,6 +1410,10 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
 
        login_info->max_cmds = cpu_to_be32(max_requests + IBMVFC_NUM_INTERNAL_REQ);
        login_info->capabilities = cpu_to_be64(IBMVFC_CAN_MIGRATE | IBMVFC_CAN_SEND_VF_WWPN);
+
+       if (vhost->mq_enabled || vhost->using_channels)
+               login_info->capabilities |= cpu_to_be64(IBMVFC_CAN_USE_CHANNELS);
+
        login_info->async.va = cpu_to_be64(vhost->async_crq.msg_token);
        login_info->async.len = cpu_to_be32(async_crq->size *
                                            sizeof(*async_crq->msgs.async));