scsi: ibmvfc: Track max and desired queue size in ibmvfc_channels
Add fields for desired and max number of queues to ibmvfc_channels. With support for NVMeoF protocol coming these sorts of values should be tracked in the protocol specific channel struct instead of the overarching host adapter. Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com> Link: https://lore.kernel.org/r/20230921225435.3537728-8-tyreld@linux.ibm.com Reviewed-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
d3558ca8a0
commit
9e5605404b
@ -1489,7 +1489,7 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
|
|||||||
max_cmds = scsi_qdepth + IBMVFC_NUM_INTERNAL_REQ;
|
max_cmds = scsi_qdepth + IBMVFC_NUM_INTERNAL_REQ;
|
||||||
if (mq_enabled)
|
if (mq_enabled)
|
||||||
max_cmds += (scsi_qdepth + IBMVFC_NUM_INTERNAL_SUBQ_REQ) *
|
max_cmds += (scsi_qdepth + IBMVFC_NUM_INTERNAL_SUBQ_REQ) *
|
||||||
vhost->client_scsi_channels;
|
vhost->scsi_scrqs.desired_queues;
|
||||||
|
|
||||||
memset(login_info, 0, sizeof(*login_info));
|
memset(login_info, 0, sizeof(*login_info));
|
||||||
|
|
||||||
@ -3578,11 +3578,12 @@ static ssize_t ibmvfc_show_scsi_channels(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct Scsi_Host *shost = class_to_shost(dev);
|
struct Scsi_Host *shost = class_to_shost(dev);
|
||||||
struct ibmvfc_host *vhost = shost_priv(shost);
|
struct ibmvfc_host *vhost = shost_priv(shost);
|
||||||
|
struct ibmvfc_channels *scsi = &vhost->scsi_scrqs;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
spin_lock_irqsave(shost->host_lock, flags);
|
spin_lock_irqsave(shost->host_lock, flags);
|
||||||
len = snprintf(buf, PAGE_SIZE, "%d\n", vhost->client_scsi_channels);
|
len = snprintf(buf, PAGE_SIZE, "%d\n", scsi->desired_queues);
|
||||||
spin_unlock_irqrestore(shost->host_lock, flags);
|
spin_unlock_irqrestore(shost->host_lock, flags);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@ -3593,12 +3594,13 @@ static ssize_t ibmvfc_store_scsi_channels(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct Scsi_Host *shost = class_to_shost(dev);
|
struct Scsi_Host *shost = class_to_shost(dev);
|
||||||
struct ibmvfc_host *vhost = shost_priv(shost);
|
struct ibmvfc_host *vhost = shost_priv(shost);
|
||||||
|
struct ibmvfc_channels *scsi = &vhost->scsi_scrqs;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
unsigned int channels;
|
unsigned int channels;
|
||||||
|
|
||||||
spin_lock_irqsave(shost->host_lock, flags);
|
spin_lock_irqsave(shost->host_lock, flags);
|
||||||
channels = simple_strtoul(buf, NULL, 10);
|
channels = simple_strtoul(buf, NULL, 10);
|
||||||
vhost->client_scsi_channels = min(channels, nr_scsi_hw_queues);
|
scsi->desired_queues = min(channels, shost->nr_hw_queues);
|
||||||
ibmvfc_hard_reset_host(vhost);
|
ibmvfc_hard_reset_host(vhost);
|
||||||
spin_unlock_irqrestore(shost->host_lock, flags);
|
spin_unlock_irqrestore(shost->host_lock, flags);
|
||||||
return strlen(buf);
|
return strlen(buf);
|
||||||
@ -5066,7 +5068,7 @@ static void ibmvfc_channel_setup(struct ibmvfc_host *vhost)
|
|||||||
struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq);
|
struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq);
|
||||||
struct ibmvfc_channels *scrqs = &vhost->scsi_scrqs;
|
struct ibmvfc_channels *scrqs = &vhost->scsi_scrqs;
|
||||||
unsigned int num_channels =
|
unsigned int num_channels =
|
||||||
min(vhost->client_scsi_channels, vhost->max_vios_scsi_channels);
|
min(scrqs->desired_queues, vhost->max_vios_scsi_channels);
|
||||||
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
int level = IBMVFC_DEFAULT_LOG_LEVEL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -6290,7 +6292,8 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||||||
vhost->task_set = 1;
|
vhost->task_set = 1;
|
||||||
|
|
||||||
vhost->mq_enabled = mq_enabled;
|
vhost->mq_enabled = mq_enabled;
|
||||||
vhost->client_scsi_channels = min(shost->nr_hw_queues, nr_scsi_channels);
|
vhost->scsi_scrqs.desired_queues = min(shost->nr_hw_queues, nr_scsi_channels);
|
||||||
|
vhost->scsi_scrqs.max_queues = shost->nr_hw_queues;
|
||||||
vhost->using_channels = 0;
|
vhost->using_channels = 0;
|
||||||
vhost->do_enquiry = 1;
|
vhost->do_enquiry = 1;
|
||||||
vhost->scan_timeout = 0;
|
vhost->scan_timeout = 0;
|
||||||
|
@ -818,6 +818,8 @@ struct ibmvfc_queue {
|
|||||||
struct ibmvfc_channels {
|
struct ibmvfc_channels {
|
||||||
struct ibmvfc_queue *scrqs;
|
struct ibmvfc_queue *scrqs;
|
||||||
unsigned int active_queues;
|
unsigned int active_queues;
|
||||||
|
unsigned int desired_queues;
|
||||||
|
unsigned int max_queues;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ibmvfc_host_action {
|
enum ibmvfc_host_action {
|
||||||
@ -876,8 +878,7 @@ struct ibmvfc_host {
|
|||||||
int log_level;
|
int log_level;
|
||||||
struct ibmvfc_discover_targets_entry *disc_buf;
|
struct ibmvfc_discover_targets_entry *disc_buf;
|
||||||
struct mutex passthru_mutex;
|
struct mutex passthru_mutex;
|
||||||
int max_vios_scsi_channels;
|
unsigned int max_vios_scsi_channels;
|
||||||
int client_scsi_channels;
|
|
||||||
int task_set;
|
int task_set;
|
||||||
int init_retries;
|
int init_retries;
|
||||||
int discovery_threads;
|
int discovery_threads;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user