mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
scsi: ibmvfc: Set and track hw queue in ibmvfc_event struct
Extract the hwq id from a SCSI command and store it in the ibmvfc_event structure to identify which Sub-CRQ to send the command down when channels are being utilized. Link: https://lore.kernel.org/r/20210114203148.246656-15-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>
This commit is contained in:
parent
c53408baa5
commit
cb72477be7
2 changed files with 6 additions and 0 deletions
|
@ -1483,6 +1483,7 @@ static void ibmvfc_init_event(struct ibmvfc_event *evt,
|
||||||
evt->_done = done;
|
evt->_done = done;
|
||||||
evt->done = ibmvfc_locked_done;
|
evt->done = ibmvfc_locked_done;
|
||||||
}
|
}
|
||||||
|
evt->hwq = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1839,6 +1840,8 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
|
||||||
struct ibmvfc_cmd *vfc_cmd;
|
struct ibmvfc_cmd *vfc_cmd;
|
||||||
struct ibmvfc_fcp_cmd_iu *iu;
|
struct ibmvfc_fcp_cmd_iu *iu;
|
||||||
struct ibmvfc_event *evt;
|
struct ibmvfc_event *evt;
|
||||||
|
u32 tag_and_hwq = blk_mq_unique_tag(cmnd->request);
|
||||||
|
u16 hwq = blk_mq_unique_tag_to_hwq(tag_and_hwq);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (unlikely((rc = fc_remote_port_chkready(rport))) ||
|
if (unlikely((rc = fc_remote_port_chkready(rport))) ||
|
||||||
|
@ -1865,6 +1868,8 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
vfc_cmd->correlation = cpu_to_be64(evt);
|
vfc_cmd->correlation = cpu_to_be64(evt);
|
||||||
|
if (vhost->using_channels)
|
||||||
|
evt->hwq = hwq % vhost->scsi_scrqs.active_queues;
|
||||||
|
|
||||||
if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
|
if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
|
||||||
return ibmvfc_send_event(evt, vhost, 0);
|
return ibmvfc_send_event(evt, vhost, 0);
|
||||||
|
|
|
@ -753,6 +753,7 @@ struct ibmvfc_event {
|
||||||
struct completion comp;
|
struct completion comp;
|
||||||
struct completion *eh_comp;
|
struct completion *eh_comp;
|
||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
|
u16 hwq;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* a pool of event structs for use */
|
/* a pool of event structs for use */
|
||||||
|
|
Loading…
Add table
Reference in a new issue