scsi: ibmvfc: Add vhost fields and defaults for MQ enablement
authorTyrel Datwyler <tyreld@linux.ibm.com>
Thu, 14 Jan 2021 20:31:28 +0000 (14:31 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jan 2021 03:27:43 +0000 (22:27 -0500)
Introduce several new vhost fields for managing MQ state of the adapter as
well as initial defaults for MQ enablement.

Link: https://lore.kernel.org/r/20210114203148.246656-2-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
drivers/scsi/ibmvscsi/ibmvfc.h

index ff86c43..e8a63cf 100644 (file)
@@ -3302,6 +3302,7 @@ static struct scsi_host_template driver_template = {
        .max_sectors = IBMVFC_MAX_SECTORS,
        .shost_attrs = ibmvfc_attrs,
        .track_queue_depth = 1,
+       .host_tagset = 1,
 };
 
 /**
@@ -5290,6 +5291,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        shost->max_sectors = IBMVFC_MAX_SECTORS;
        shost->max_cmd_len = IBMVFC_MAX_CDB_LEN;
        shost->unique_id = shost->host_no;
+       shost->nr_hw_queues = IBMVFC_MQ ? IBMVFC_SCSI_HW_QUEUES : 1;
 
        vhost = shost_priv(shost);
        INIT_LIST_HEAD(&vhost->targets);
@@ -5300,6 +5302,12 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        vhost->partition_number = -1;
        vhost->log_level = log_level;
        vhost->task_set = 1;
+
+       vhost->mq_enabled = IBMVFC_MQ;
+       vhost->client_scsi_channels = IBMVFC_SCSI_CHANNELS;
+       vhost->using_channels = 0;
+       vhost->do_enquiry = 1;
+
        strcpy(vhost->partition_name, "UNKNOWN");
        init_waitqueue_head(&vhost->work_wait_q);
        init_waitqueue_head(&vhost->init_wait_q);
index 632e977..dd6d892 100644 (file)
 #define IBMVFC_DEFAULT_LOG_LEVEL       2
 #define IBMVFC_MAX_CDB_LEN             16
 #define IBMVFC_CLS3_ERROR              0
+#define IBMVFC_MQ                      0
+#define IBMVFC_SCSI_CHANNELS           0
+#define IBMVFC_SCSI_HW_QUEUES          1
+#define IBMVFC_MIG_NO_SUB_TO_CRQ       0
+#define IBMVFC_MIG_NO_N_TO_M           0
 
 /*
  * Ensure we have resources for ERP and initialization:
@@ -840,6 +845,10 @@ struct ibmvfc_host {
        int delay_init;
        int scan_complete;
        int logged_in;
+       int mq_enabled;
+       int using_channels;
+       int do_enquiry;
+       int client_scsi_channels;
        int aborting_passthru;
        int events_to_log;
 #define IBMVFC_AE_LINKUP       0x0001