queue_type fixups
Subsystems (27)
These are a few patches that follow up my previous cleanups for the queue depth and type handling.
The first patch removes the now pointless write support for the queue_type sysfs attribute. The second changes the queue full tracking code to never drop out of tagged mode, as we can't recover from that, and the last two are random cleanups.
PATCH 1/4 scsi: remove ->change_queue_type method
Since we got rid of ordered tag support in 2010 the prime use case of switching on and off ordered tags has been obsolete. The other function of enabling/dsiabling tagging entirely has only been correctly implemented by the 53c700 driver and isn't generally useful.
--- drivers/infiniband/ulp/srp/ib_srp.c | 1 - drivers/scsi/53c700.c | 35 ----------------------------------- drivers/scsi/aic94xx/aic94xx_init.c | 1 - drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 - drivers/scsi/esas2r/esas2r_main.c | 1 - drivers/scsi/fcoe/fcoe.c | 1 - drivers/scsi/fnic/fnic_main.c | 1 - drivers/scsi/ibmvscsi/ibmvfc.c | 1 - drivers/scsi/ipr.c | 25 ------------------------- drivers/scsi/isci/init.c | 1 - drivers/scsi/libsas/sas_scsi_host.c | 8 -------- drivers/scsi/lpfc/lpfc_scsi.c | 2 -- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 1 - drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - drivers/scsi/pmcraid.c | 1 - drivers/scsi/qla2xxx/qla_os.c | 1 - drivers/scsi/scsi.c | 16 ---------------- drivers/scsi/scsi_debug.c | 27 --------------------------- drivers/scsi/scsi_sysfs.c | 30 ++++-------------------------- drivers/target/loopback/tcm_loop.c | 1 - include/scsi/libsas.h | 1 - include/scsi/scsi_host.h | 13 ------------- include/scsi/scsi_tcq.h | 3 --- 25 files changed, 4 insertions(+), 171 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +0 -1
@@ -2740,7 +2740,6 @@ static struct scsi_host_template srp_template = { .info = srp_target_info, .queuecommand = srp_queuecommand, .change_queue_depth = srp_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .eh_abort_handler = srp_abort, .eh_device_reset_handler = srp_reset_device, .eh_host_reset_handler = srp_reset_host,
drivers/scsi/53c700.c +0 -35
@@ -176,7 +176,6 @@ STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt); STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);static int NCR_700_change_queue_depth (struct scsi_device *SDpnt,int depth); -static int NCR_700_change_queue_type (struct scsi_device *SDpnt,int depth); STATIC struct device_attribute *NCR_700_dev_attrs[];
@@ -326,7 +325,6 @@ NCR_700_detect(struct scsi_host_template *tpnt, tpnt->slave_destroy = NCR_700_slave_destroy; tpnt->slave_alloc = NCR_700_slave_alloc; tpnt->change_queue_depth = NCR_700_change_queue_depth; - tpnt->change_queue_type = NCR_700_change_queue_type; tpnt->use_blk_tags =1 ;if (tpnt->name ==NULL )
@@ -2082,39 +2080,6 @@ NCR_700_change_queue_depth(struct scsi_device *SDp, int depth)return scsi_change_queue_depth (SDp, depth); } -static int NCR_700_change_queue_type (struct scsi_device *SDp,int tag_type) -{ -int change_tag = ((tag_type ==0 &&scsi_get_tag_type (SDp) !=0 ) - || (tag_type !=0 &&scsi_get_tag_type (SDp) ==0 )); -struct NCR_700_Host_Parameters *hostdata = - (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0 ]; - -/* We have a global (per target) flag to track whether TCQ is -* enabled, so we'll be turning it off for the entire target here. -* our tag algorithm will fail if we mix tagged and untagged commands, -* so quiesce the device before doing this */ -if (change_tag) -scsi_target_quiesce (SDp->sdev_target); - -scsi_set_tag_type (SDp, tag_type); -if (!tag_type) { -/* shift back to the default unqueued number of commands -* (the user can still raise this) */ -scsi_change_queue_depth (SDp, SDp->host->cmd_per_lun); - hostdata->tag_negotiated &= ~(1 <<sdev_id (SDp)); - }else { -/* Here, we cleared the negotiation flag above, so this -* will force the driver to renegotiate */ -scsi_change_queue_depth (SDp, SDp->queue_depth); -if (change_tag) -NCR_700_set_tag_neg_state (SDp,NCR_700_START_TAG_NEGOTIATION ); - } -if (change_tag) -scsi_target_resume (SDp->sdev_target); - -return tag_type; -} -static ssize_t NCR_700_show_active_tags (struct device *dev,struct device_attribute *attr,char *buf) {
drivers/scsi/aic94xx/aic94xx_init.c +0 -1
@@ -71,7 +71,6 @@ static struct scsi_host_template aic94xx_sht = { .scan_finished = asd_scan_finished, .scan_start = asd_scan_start, .change_queue_depth = sas_change_queue_depth, - .change_queue_type = sas_change_queue_type, .bios_param = sas_bios_param, .can_queue = 1, .cmd_per_lun = 1,
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +0 -1
@@ -2785,7 +2785,6 @@ static struct scsi_host_template bnx2fc_shost_template = { .eh_host_reset_handler = fc_eh_host_reset, .slave_alloc = fc_slave_alloc, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .this_id = -1, .cmd_per_lun = 3, .use_clustering = ENABLE_CLUSTERING,
drivers/scsi/esas2r/esas2r_main.c +0 -1
@@ -255,7 +255,6 @@ static struct scsi_host_template driver_template = { .emulated = 0, .proc_name = ESAS2R_DRVR_NAME, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .max_sectors = 0xFFFF, .use_blk_tags = 1, };
drivers/scsi/fcoe/fcoe.c +0 -1
@@ -281,7 +281,6 @@ static struct scsi_host_template fcoe_shost_template = { .eh_host_reset_handler = fc_eh_host_reset, .slave_alloc = fc_slave_alloc, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .this_id = -1, .cmd_per_lun = 3, .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
drivers/scsi/fnic/fnic_main.c +0 -1
@@ -111,7 +111,6 @@ static struct scsi_host_template fnic_host_template = { .eh_host_reset_handler = fnic_host_reset, .slave_alloc = fnic_slave_alloc, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .this_id = -1, .cmd_per_lun = 3, .can_queue = FNIC_DFLT_IO_REQ,
drivers/scsi/ibmvscsi/ibmvfc.c +0 -1
@@ -3089,7 +3089,6 @@ static struct scsi_host_template driver_template = { .target_alloc = ibmvfc_target_alloc, .scan_finished = ibmvfc_scan_finished, .change_queue_depth = ibmvfc_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .cmd_per_lun = 16, .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT, .this_id = -1,
drivers/scsi/ipr.c +0 -25
@@ -4346,30 +4346,6 @@ static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth) }/** -* ipr_change_queue_type - Change the device's queue type -* @dsev: scsi device struct -* @tag_type: type of tags to use -* -* Return value: -* actual queue type set -**/ -static int ipr_change_queue_type (struct scsi_device *sdev,int tag_type) -{ -struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata; -struct ipr_resource_entry *res; -unsigned long lock_flags =0 ; - -spin_lock_irqsave (ioa_cfg->host->host_lock, lock_flags); - res = (struct ipr_resource_entry *)sdev->hostdata; -if (res &&ipr_is_gscsi (res)) - tag_type =scsi_change_queue_type (sdev, tag_type); -else - tag_type =0 ; -spin_unlock_irqrestore (ioa_cfg->host->host_lock, lock_flags); -return tag_type; -} - -/** * ipr_show_adapter_handle - Show the adapter's resource handle for this device * @dev: device struct * @attr: device attribute structure
@@ -6302,7 +6278,6 @@ static struct scsi_host_template driver_template = { .target_alloc = ipr_target_alloc, .target_destroy = ipr_target_destroy, .change_queue_depth = ipr_change_queue_depth, - .change_queue_type = ipr_change_queue_type, .bios_param = ipr_biosparam, .can_queue = IPR_MAX_COMMANDS, .this_id = -1,
drivers/scsi/isci/init.c +0 -1
@@ -158,7 +158,6 @@ static struct scsi_host_template isci_sht = { .scan_finished = isci_host_scan_finished, .scan_start = isci_host_start, .change_queue_depth = sas_change_queue_depth, - .change_queue_type = sas_change_queue_type, .bios_param = sas_bios_param, .can_queue = ISCI_CAN_QUEUE_VAL, .cmd_per_lun = 1,
drivers/scsi/libsas/sas_scsi_host.c +0 -8
@@ -965,13 +965,6 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth)return scsi_change_queue_depth (sdev, depth); } -int sas_change_queue_type (struct scsi_device *scsi_dev,int type) -{ -if (dev_is_sata (sdev_to_domain_dev (scsi_dev))) -return -EINVAL ; -return scsi_change_queue_type (scsi_dev, type); -} -int sas_bios_param (struct scsi_device *scsi_dev,struct block_device *bdev,sector_t capacity,int *hsc)
@@ -1185,7 +1178,6 @@ EXPORT_SYMBOL_GPL(sas_queuecommand);EXPORT_SYMBOL_GPL (sas_target_alloc);EXPORT_SYMBOL_GPL (sas_slave_configure);EXPORT_SYMBOL_GPL (sas_change_queue_depth); -EXPORT_SYMBOL_GPL (sas_change_queue_type);EXPORT_SYMBOL_GPL (sas_bios_param);EXPORT_SYMBOL_GPL (sas_task_abort);EXPORT_SYMBOL_GPL (sas_phy_reset);
drivers/scsi/lpfc/lpfc_scsi.c +0 -2
@@ -5879,7 +5879,6 @@ struct scsi_host_template lpfc_template = { .max_sectors = 0xFFFF, .vendor_id = LPFC_NL_VENDOR_ID, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .use_blk_tags = 1, .track_queue_depth = 1, };
@@ -5904,7 +5903,6 @@ struct scsi_host_template lpfc_vport_template = { .shost_attrs = lpfc_vport_attrs, .max_sectors = 0xFFFF, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .use_blk_tags = 1, .track_queue_depth = 1, };
drivers/scsi/mpt2sas/mpt2sas_scsih.c +0 -1
@@ -7592,7 +7592,6 @@ static struct scsi_host_template scsih_driver_template = { .scan_finished = _scsih_scan_finished, .scan_start = _scsih_scan_start, .change_queue_depth = _scsih_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .eh_abort_handler = _scsih_abort, .eh_device_reset_handler = _scsih_dev_reset, .eh_target_reset_handler = _scsih_target_reset,
drivers/scsi/mpt3sas/mpt3sas_scsih.c +0 -1
@@ -7229,7 +7229,6 @@ static struct scsi_host_template scsih_driver_template = { .scan_finished = _scsih_scan_finished, .scan_start = _scsih_scan_start, .change_queue_depth = _scsih_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .eh_abort_handler = _scsih_abort, .eh_device_reset_handler = _scsih_dev_reset, .eh_target_reset_handler = _scsih_target_reset,
drivers/scsi/mvsas/mv_init.c +0 -1
@@ -63,7 +63,6 @@ static struct scsi_host_template mvs_sht = { .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start, .change_queue_depth = sas_change_queue_depth, - .change_queue_type = sas_change_queue_type, .bios_param = sas_bios_param, .can_queue = 1, .cmd_per_lun = 1,
drivers/scsi/pm8001/pm8001_init.c +0 -1
@@ -76,7 +76,6 @@ static struct scsi_host_template pm8001_sht = { .scan_finished = pm8001_scan_finished, .scan_start = pm8001_scan_start, .change_queue_depth = sas_change_queue_depth, - .change_queue_type = sas_change_queue_type, .bios_param = sas_bios_param, .can_queue = 1, .cmd_per_lun = 1,
drivers/scsi/pmcraid.c +0 -1
@@ -4251,7 +4251,6 @@ static struct scsi_host_template pmcraid_host_template = { .slave_configure = pmcraid_slave_configure, .slave_destroy = pmcraid_slave_destroy, .change_queue_depth = pmcraid_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .can_queue = PMCRAID_MAX_IO_CMD, .this_id = -1, .sg_tablesize = PMCRAID_MAX_IOADLS,
drivers/scsi/qla2xxx/qla_os.c +0 -1
@@ -258,7 +258,6 @@ struct scsi_host_template qla2xxx_driver_template = { .scan_finished = qla2xxx_scan_finished, .scan_start = qla2xxx_scan_start, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .this_id = -1, .cmd_per_lun = 3, .use_clustering = ENABLE_CLUSTERING,
drivers/scsi/scsi.c +0 -16
@@ -832,22 +832,6 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)EXPORT_SYMBOL (scsi_track_queue_full);/** -* scsi_change_queue_type() - Change a device's queue type -* @sdev: The SCSI device whose queue depth is to change -* @tag_type: Identifier for queue type -*/ -int scsi_change_queue_type (struct scsi_device *sdev,int tag_type) -{ -if (!sdev->tagged_supported) -return 0 ; - -scsi_set_tag_type (sdev, tag_type); -return tag_type; - -} -EXPORT_SYMBOL (scsi_change_queue_type); - -/** * scsi_vpd_inquiry - Request a device provide us with a VPD page * @sdev: The device to ask * @buffer: Where to put the result
drivers/scsi/scsi_debug.c +0 -27
@@ -4499,32 +4499,6 @@ sdebug_change_qdepth(struct scsi_device *sdev, int qdepth)return sdev->queue_depth; } -static int -sdebug_change_qtype (struct scsi_device *sdev,int qtype) -{ - qtype =scsi_change_queue_type (sdev, qtype); -if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) { -const char *cp; - -switch (qtype) { -case 0 : - cp ="untagged" ; -break ; -case MSG_SIMPLE_TAG : - cp ="simple tags" ; -break ; -case MSG_ORDERED_TAG : - cp ="ordered tags" ; -break ; -default : - cp ="unknown" ; -break ; - } -sdev_printk (KERN_INFO , sdev,"%s: to %s\n" , __func__, cp); - } -return qtype; -} -static struct scsi_host_template sdebug_driver_template = { .show_info = scsi_debug_show_info, .write_info = scsi_debug_write_info,
@@ -4537,7 +4511,6 @@ static struct scsi_host_template sdebug_driver_template = { .ioctl = scsi_debug_ioctl, .queuecommand = sdebug_queuecommand_lock_or_not, .change_queue_depth = sdebug_change_qdepth, - .change_queue_type = sdebug_change_qtype, .eh_abort_handler = scsi_debug_abort, .eh_device_reset_handler = scsi_debug_device_reset, .eh_target_reset_handler = scsi_debug_target_reset,
drivers/scsi/scsi_sysfs.c +4 -26
@@ -738,30 +738,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {struct scsi_device *sdev =to_scsi_device (dev); -struct scsi_host_template *sht = sdev->host->hostt; -int tag_type =0 , retval; -int prev_tag_type =scsi_get_tag_type (sdev); - -if (!sdev->tagged_supported || !sht->change_queue_type) -return -EINVAL ; -/* -* We're never issueing order tags these days, but allow the value -* for backwards compatibility. -*/ -if (strncmp (buf,"ordered" ,7 ) ==0 || -strncmp (buf,"simple" ,6 ) ==0 ) - tag_type =MSG_SIMPLE_TAG ; -else if (strncmp (buf,"none" ,4 ) !=0 ) +if (!sdev->tagged_supported)return -EINVAL ; - -if (tag_type == prev_tag_type) -return count; - - retval = sht->change_queue_type (sdev, tag_type); -if (retval <0 ) -return retval; - + +sdev_printk (KERN_INFO , sdev, +"ignoring write to deprecated queue_type attribute" );return count; }
@@ -938,10 +920,6 @@ static umode_t scsi_sdev_attr_is_visible(struct kobject *kobj, !sdev->host->hostt->change_queue_depth)return 0 ; -if (attr == &dev_attr_queue_type.attr && - !sdev->host->hostt->change_queue_type) -return S_IRUGO ; -return attr->mode; }
drivers/target/loopback/tcm_loop.c +0 -1
@@ -385,7 +385,6 @@ static struct scsi_host_template tcm_loop_driver_template = { .name = "TCM_Loopback", .queuecommand = tcm_loop_queuecommand, .change_queue_depth = scsi_change_queue_depth, - .change_queue_type = scsi_change_queue_type, .eh_abort_handler = tcm_loop_abort_task, .eh_device_reset_handler = tcm_loop_device_reset, .eh_target_reset_handler = tcm_loop_target_reset,
include/scsi/libsas.h +0 -1
@@ -705,7 +705,6 @@ extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *);extern int sas_target_alloc (struct scsi_target *);extern int sas_slave_configure (struct scsi_device *);extern int sas_change_queue_depth (struct scsi_device *,int new_depth); -extern int sas_change_queue_type (struct scsi_device *,int qt);extern int sas_bios_param (struct scsi_device *,struct block_device *,sector_t capacity,int *hsc);
include/scsi/scsi_host.h +0 -13
@@ -278,19 +278,6 @@ struct scsi_host_template {int (* change_queue_depth)(struct scsi_device *,int );/* -* Fill in this function to allow the changing of tag types -* (this also allows the enabling/disabling of tag command -* queueing). An error should only be returned if something -* went wrong in the driver while trying to set the tag type. -* If the driver doesn't support the requested tag type, then -* it should set the closest type it does support without -* returning an error. Returns the actual tag type set. -* -* Status: OPTIONAL -*/ -int (* change_queue_type)(struct scsi_device *,int ); - -/* * This function determines the BIOS parameters for a given * harddisk. These tend to be numbers that are made up by * the host adapter. Parameters:
include/scsi/scsi_tcq.h +0 -3
@@ -15,9 +15,6 @@#ifdef CONFIG_BLOCK - -int scsi_change_queue_type (struct scsi_device *sdev,int tag_type); -/** * scsi_get_tag_type - get the type of tag the device supports * @sdev: the scsi device
Signature · 1 line
1.9.1
PATCH 2/4 scsi: never drop to untagged mode during queue ramp down
In reply to Christoph HellwigDropping to untagged mode when ramping down a queue due to QUEUE FULL events has two problems:
- nothing in the midlayer or drivers ever moves back to tagged mode during queue ramp up.
- cmd_per_lun isn't the untagged queue depth for many modern drivers that can handle multiple untagged commands, and this is the only place in the midlayer assuming that.
--- drivers/scsi/scsi.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/scsi/scsi.c +0 -6
@@ -820,12 +820,6 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)if (sdev->last_queue_full_count <=10 )return 0 ; -if (sdev->last_queue_full_depth <8 ) { -/* Drop back to untagged */ -scsi_set_tag_type (sdev,0 ); -scsi_change_queue_depth (sdev, sdev->host->cmd_per_lun); -return -1 ; - }return scsi_change_queue_depth (sdev, depth); }
Signature · 1 line
1.9.1
PATCH 3/4 scsi: remove scsi_get_tag_type
In reply to Christoph HellwigBoth remaining users are better of just checking sdev->simple_tags directly.
--- drivers/scsi/53c700.c | 4 ++-- drivers/scsi/ipr.c | 2 +- include/scsi/scsi_tcq.h | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-)
drivers/scsi/53c700.c +2 -2
@@ -1816,8 +1816,8 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *) hostdata->tag_negotiated &= ~(1 <<scmd_id (SCp)); } -if ((hostdata->tag_negotiated &(1 <<scmd_id (SCp))) - &&scsi_get_tag_type (SCp->device)) { +if ((hostdata->tag_negotiated & (1 <<scmd_id (SCp))) && + SCp->device->simple_tags) { slot->tag = SCp->request->tag;CDEBUG (KERN_DEBUG , SCp,"sending out tag %d, slot %p\n" , slot->tag, slot);
drivers/scsi/ipr.c +1 -1
@@ -5755,7 +5755,7 @@ static void ipr_erp_cancel_all(struct ipr_cmnd *ipr_cmd)ipr_reinit_ipr_cmnd_for_erp (ipr_cmd); -if (!scsi_get_tag_type (scsi_cmd->device)) { +if (!scsi_cmd->device->simple_tags) {ipr_erp_request_sense (ipr_cmd);return ; }
include/scsi/scsi_tcq.h +0 -13
@@ -15,19 +15,6 @@#ifdef CONFIG_BLOCK -/** -* scsi_get_tag_type - get the type of tag the device supports -* @sdev: the scsi device -*/ -static inline int scsi_get_tag_type (struct scsi_device *sdev) -{ -if (!sdev->tagged_supported) -return 0 ; -if (sdev->simple_tags) -return MSG_SIMPLE_TAG ; -return 0 ; -} -static inline void scsi_set_tag_type (struct scsi_device *sdev,int tag) {switch (tag) {
Signature · 1 line
1.9.1
PATCH 4/4 scsi: remove scsi_set_tag_type
In reply to Christoph HellwigThere is no benefit over just setting sdev->simple_tags directly.
--- drivers/scsi/53c700.c | 2 +- drivers/scsi/tmscsim.c | 2 +- include/scsi/scsi_tcq.h | 15 --------------- 3 files changed, 2 insertions(+), 17 deletions(-)
drivers/scsi/53c700.c +1 -1
@@ -902,8 +902,8 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata hostdata->tag_negotiated &= ~(1 <<scmd_id (SCp)); SCp->device->tagged_supported =0 ; + SCp->device->simple_tags =0 ;scsi_change_queue_depth (SCp->device, host->cmd_per_lun); -scsi_set_tag_type (SCp->device,0 ); }else { shost_printk(KERN_WARNING, host, "(%d:%d) Unexpected REJECT Message %s\n",
drivers/scsi/tmscsim.c +1 -1
@@ -2190,7 +2190,7 @@ static int dc390_slave_configure(struct scsi_device *sdev)* XXX: Note that while this driver used to called scsi_activate_tcq, * it never actually set a tag type, so emulate the old behavior. */ -scsi_set_tag_type (sdev,0 ); + sdev->simple_tags =0 ;if (sdev->tagged_supported && (dcb->DevMode &TAG_QUEUEING_ )) { dcb->SyncMode |=EN_TAG_QUEUEING ;
include/scsi/scsi_tcq.h +0 -15
@@ -15,21 +15,6 @@#ifdef CONFIG_BLOCK -static inline void scsi_set_tag_type (struct scsi_device *sdev,int tag) -{ -switch (tag) { -case MSG_ORDERED_TAG : -case MSG_SIMPLE_TAG : - sdev->simple_tags =1 ; -break ; -case 0 : -/* fall through */ -default : - sdev->simple_tags =0 ; -break ; - } -} -static inline struct scsi_cmnd *scsi_mq_find_tag (struct Scsi_Host *shost,int unique_tag) {
Signature · 1 line
1.9.1
[PATCH 5/4] scsi: remove MSG_*_TAG defines
In reply to Christoph HellwigFor SPI drivers use the message defintions from scsi.c, and for target drivers introduce a new TCM_*_TAG namespace.
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 10 +++++----- drivers/scsi/advansys.c | 8 ++++---- drivers/scsi/qla2xxx/qla_target.c | 12 ++++++------ drivers/scsi/scsi_debug.c | 1 - drivers/scsi/scsi_transport_spi.c | 2 +- drivers/scsi/tmscsim.c | 2 +- drivers/target/iscsi/iscsi_target.c | 14 +++++++------- drivers/target/loopback/tcm_loop.c | 4 ++-- drivers/target/sbp/sbp_target.c | 2 +- drivers/target/target_core_pscsi.c | 2 +- drivers/target/target_core_sbc.c | 2 +- drivers/target/target_core_spc.c | 4 ++-- drivers/target/target_core_transport.c | 16 ++++++++-------- drivers/target/tcm_fc/tfc_cmd.c | 8 ++++---- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 10 +++++----- drivers/xen/xen-scsiback.c | 2 +- include/scsi/scsi_tcq.h | 5 ----- include/target/target_core_base.h | 6 ++++++ include/trace/events/target.h | 8 ++++---- 19 files changed, 59 insertions(+), 59 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +5 -5
@@ -1708,17 +1708,17 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch,switch (srp_cmd->task_attr) {case SRP_CMD_SIMPLE_Q : - cmd->sam_task_attr =MSG_SIMPLE_TAG ; + cmd->sam_task_attr =TCM_SIMPLE_TAG ;break ;case SRP_CMD_ORDERED_Q :default : - cmd->sam_task_attr =MSG_ORDERED_TAG ; + cmd->sam_task_attr =TCM_ORDERED_TAG ;break ;case SRP_CMD_HEAD_OF_Q : - cmd->sam_task_attr =MSG_HEAD_TAG ; + cmd->sam_task_attr =TCM_HEAD_TAG ;break ;case SRP_CMD_ACA : - cmd->sam_task_attr =MSG_ACA_TAG ; + cmd->sam_task_attr =TCM_ACA_TAG ;break ; }
@@ -1733,7 +1733,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, sizeof(srp_cmd->lun)); rc =target_submit_cmd (cmd, ch->sess, srp_cmd->cdb, &send_ioctx->sense_data[0 ], unpacked_lun, data_len, -MSG_SIMPLE_TAG , dir,TARGET_SCF_ACK_KREF ); +TCM_SIMPLE_TAG , dir,TARGET_SCF_ACK_KREF );if (rc !=0 ) { ret =TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ; goto send_sense;
drivers/scsi/advansys.c +4 -4
@@ -7921,9 +7921,9 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,*/ if ((asc_dvc->cur_dvc_qng[scp->device->id] >0 ) && (boardp->reqcnt[scp->device->id] %255 ) ==0 ) { - asc_scsi_q->q2.tag_code =MSG_ORDERED_TAG ; + asc_scsi_q->q2.tag_code =ORDERED_QUEUE_TAG ; }else { - asc_scsi_q->q2.tag_code =MSG_SIMPLE_TAG ; + asc_scsi_q->q2.tag_code =SIMPLE_QUEUE_TAG ; }/* Build ASC_SCSI_Q */
@@ -8351,7 +8351,7 @@ static int AscPutReadyQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no) } q_addr =ASC_QNO_TO_QADDR (q_no);if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) ==0 ) { - scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; } scsiq->q1.status =QS_FREE ; AscMemWordCopyPtrToLram(iop_base,
@@ -8669,7 +8669,7 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq) } }if (disable_syn_offset_one_fix) { - scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |ASC_TAG_FLAG_DISABLE_DISCONNECT ); }else {
drivers/scsi/qla2xxx/qla_target.c +6 -6
@@ -3218,25 +3218,25 @@ static inline int qlt_get_fcp_task_attr(struct scsi_qla_host *vha,switch (task_codes) {case ATIO_SIMPLE_QUEUE : - fcp_task_attr =MSG_SIMPLE_TAG ; + fcp_task_attr =TCM_SIMPLE_TAG ;break ;case ATIO_HEAD_OF_QUEUE : - fcp_task_attr =MSG_HEAD_TAG ; + fcp_task_attr =TCM_HEAD_TAG ;break ;case ATIO_ORDERED_QUEUE : - fcp_task_attr =MSG_ORDERED_TAG ; + fcp_task_attr =TCM_ORDERED_TAG ;break ;case ATIO_ACA_QUEUE : - fcp_task_attr =MSG_ACA_TAG ; + fcp_task_attr =TCM_ACA_TAG ;break ;case ATIO_UNTAGGED : - fcp_task_attr =MSG_SIMPLE_TAG ; + fcp_task_attr =TCM_SIMPLE_TAG ;break ;default :ql_dbg (ql_dbg_tgt_mgt, vha,0xf05d ,"qla_target: unknown task code %x, use ORDERED instead\n" , task_codes); - fcp_task_attr =MSG_ORDERED_TAG ; + fcp_task_attr =TCM_ORDERED_TAG ;break ; }
drivers/scsi/scsi_debug.c +0 -1
@@ -125,7 +125,6 @@ static const char *scsi_debug_version_date = "20140706";#define DEF_REMOVABLE false#define DEF_SCSI_LEVEL 6/* INQUIRY, byte2 [6->SPC-4] */ #define DEF_SECTOR_SIZE 512 -#define DEF_TAGGED_QUEUING 0/* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */ #define DEF_UNMAP_ALIGNMENT 0#define DEF_UNMAP_GRANULARITY 1#define DEF_UNMAP_MAX_BLOCKS 0xFFFFFFFF
drivers/scsi/scsi_transport_spi.c +1 -1
@@ -1221,7 +1221,7 @@ EXPORT_SYMBOL_GPL(spi_populate_ppr_msg);int spi_populate_tag_msg (unsigned char *msg,struct scsi_cmnd *cmd) {if (cmd->flags &SCMD_TAGGED ) { - *msg++ =MSG_SIMPLE_TAG ; + *msg++ =SIMPLE_QUEUE_TAG ; *msg++ = cmd->request->tag;return 2 ; }
drivers/scsi/tmscsim.c +1 -1
@@ -559,7 +559,7 @@ dc390_StartSCSI( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srDC390_write8 (ScsiFifo,IDENTIFY (disc_allowed, pDCB->TargetLUN));/* Change 99/05/31: Don't use tags when not disconnecting (BUSY) */ if ((pDCB->SyncMode &EN_TAG_QUEUEING ) && disc_allowed && (scmd->flags &SCMD_TAGGED )) { -DC390_write8 (ScsiFifo,MSG_SIMPLE_TAG ); +DC390_write8 (ScsiFifo,SIMPLE_QUEUE_TAG ); pDCB->TagMask |=1 << scmd->request->tag; pSRB->TagNumber = scmd->request->tag;DC390_write8 (ScsiFifo, scmd->request->tag);
drivers/target/iscsi/iscsi_target.c +7 -7
@@ -943,17 +943,17 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,*/ if ((iscsi_task_attr ==ISCSI_ATTR_UNTAGGED ) || (iscsi_task_attr ==ISCSI_ATTR_SIMPLE )) - sam_task_attr =MSG_SIMPLE_TAG ; + sam_task_attr =TCM_SIMPLE_TAG ;else if (iscsi_task_attr ==ISCSI_ATTR_ORDERED ) - sam_task_attr =MSG_ORDERED_TAG ; + sam_task_attr =TCM_ORDERED_TAG ;else if (iscsi_task_attr ==ISCSI_ATTR_HEAD_OF_QUEUE ) - sam_task_attr =MSG_HEAD_TAG ; + sam_task_attr =TCM_HEAD_TAG ;else if (iscsi_task_attr ==ISCSI_ATTR_ACA ) - sam_task_attr =MSG_ACA_TAG ; + sam_task_attr =TCM_ACA_TAG ;else {pr_debug ("Unknown iSCSI Task Attribute: 0x%02x, using" -" MSG_SIMPLE_TAG\n" , iscsi_task_attr); - sam_task_attr =MSG_SIMPLE_TAG ; +" TCM_SIMPLE_TAG\n" , iscsi_task_attr); + sam_task_attr =TCM_SIMPLE_TAG ; } cmd->iscsi_opcode =ISCSI_OP_SCSI_CMD ;
@@ -1811,7 +1811,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,transport_init_se_cmd (&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops, conn->sess->se_sess,0 ,DMA_NONE , -MSG_SIMPLE_TAG , cmd->sense_buffer +2 ); +TCM_SIMPLE_TAG , cmd->sense_buffer +2 );target_get_sess_cmd (conn->sess->se_sess, &cmd->se_cmd, true); sess_ref = true;
drivers/target/loopback/tcm_loop.c +2 -2
@@ -168,7 +168,7 @@ static void tcm_loop_submission_work(struct work_struct *work) rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun, - transfer_length, MSG_SIMPLE_TAG, + transfer_length, TCM_SIMPLE_TAG, sc->sc_data_direction, 0, scsi_sglist(sc), scsi_sg_count(sc), sgl_bidi, sgl_bidi_count,
@@ -248,7 +248,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,* Initialize struct se_cmd descriptor from target_core_mod infrastructure */ transport_init_se_cmd (se_cmd, se_tpg->se_tpg_tfo, se_sess,0 , -DMA_NONE ,MSG_SIMPLE_TAG , +DMA_NONE ,TCM_SIMPLE_TAG , &tl_cmd->tl_sense_buf[0 ]); rc =core_tmr_alloc_req (se_cmd, tl_tmr, tmr,GFP_KERNEL );
drivers/target/sbp/sbp_target.c +1 -1
@@ -1237,7 +1237,7 @@ static void sbp_handle_command(struct sbp_target_request *req)if (target_submit_cmd (&req->se_cmd, sess->se_sess, req->cmd_buf, req->sense_buf, unpacked_lun, data_length, -MSG_SIMPLE_TAG , data_dir,0 )) +TCM_SIMPLE_TAG , data_dir,0 )) goto err;return ;
drivers/target/target_core_pscsi.c +1 -1
@@ -1094,7 +1094,7 @@ pscsi_execute_cmd(struct se_cmd *cmd) req->retries =PS_RETRY ;blk_execute_rq_nowait (pdv->pdv_sd->request_queue,NULL , req, - (cmd->sam_task_attr ==MSG_HEAD_TAG ), + (cmd->sam_task_attr ==TCM_HEAD_TAG ), pscsi_req_done);return 0 ;
drivers/target/target_core_sbc.c +1 -1
@@ -485,7 +485,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) cmd->t_data_nents_orig = cmd->t_data_nents; cmd->t_data_nents =1 ; - cmd->sam_task_attr =MSG_HEAD_TAG ; + cmd->sam_task_attr =TCM_HEAD_TAG ; cmd->transport_complete_callback = compare_and_write_post;/* * Now reset ->execute_cmd() to the normal sbc_execute_rw() handler
drivers/target/target_core_spc.c +2 -2
@@ -1357,7 +1357,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)* Do implicit HEAD_OF_QUEUE processing for INQUIRY. * See spc4r17 section 5.3 */ - cmd->sam_task_attr =MSG_HEAD_TAG ; + cmd->sam_task_attr =TCM_HEAD_TAG ; cmd->execute_cmd = spc_emulate_inquiry;break ;case SECURITY_PROTOCOL_IN :
@@ -1391,7 +1391,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)* Do implicit HEAD_OF_QUEUE processing for REPORT_LUNS * See spc4r17 section 5.3 */ - cmd->sam_task_attr =MSG_HEAD_TAG ; + cmd->sam_task_attr =TCM_HEAD_TAG ;break ;case TEST_UNIT_READY : cmd->execute_cmd = spc_emulate_testunitready;
drivers/target/target_core_transport.c +8 -8
@@ -1159,7 +1159,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)if (dev->transport->transport_type ==TRANSPORT_PLUGIN_PHBA_PDEV )return 0 ; -if (cmd->sam_task_attr ==MSG_ACA_TAG ) { +if (cmd->sam_task_attr ==TCM_ACA_TAG ) {pr_debug ("SAM Task Attribute ACA" " emulation is not supported\n" );return TCM_INVALID_CDB_FIELD ;
@@ -1531,7 +1531,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,BUG_ON (!se_tpg);transport_init_se_cmd (se_cmd, se_tpg->se_tpg_tfo, se_sess, -0 ,DMA_NONE ,MSG_SIMPLE_TAG , sense); +0 ,DMA_NONE ,TCM_SIMPLE_TAG , sense);/* * FIXME: Currently expect caller to handle se_cmd->se_tmr_req * allocation failure.
@@ -1718,12 +1718,12 @@ static bool target_handle_task_attr(struct se_cmd *cmd)* to allow the passed struct se_cmd list of tasks to the front of the list. */ switch (cmd->sam_task_attr) { -case MSG_HEAD_TAG : +case TCM_HEAD_TAG :pr_debug ("Added HEAD_OF_QUEUE for CDB: 0x%02x, " "se_ordered_id: %u\n" , cmd->t_task_cdb[0 ], cmd->se_ordered_id);return false; -case MSG_ORDERED_TAG : +case TCM_ORDERED_TAG :atomic_inc_mb (&dev->dev_ordered_sync); pr_debug("Added ORDERED for CDB: 0x%02x to ordered list, "
@@ -1828,7 +1828,7 @@ static void target_restart_delayed_cmds(struct se_device *dev)__target_execute_cmd (cmd); -if (cmd->sam_task_attr ==MSG_ORDERED_TAG ) +if (cmd->sam_task_attr ==TCM_ORDERED_TAG )break ; } }
@@ -1844,18 +1844,18 @@ static void transport_complete_task_attr(struct se_cmd *cmd)if (dev->transport->transport_type ==TRANSPORT_PLUGIN_PHBA_PDEV )return ; -if (cmd->sam_task_attr ==MSG_SIMPLE_TAG ) { +if (cmd->sam_task_attr ==TCM_SIMPLE_TAG ) {atomic_dec_mb (&dev->simple_cmds); dev->dev_cur_ordered_id++;pr_debug ("Incremented dev->dev_cur_ordered_id: %u for" " SIMPLE: %u\n" , dev->dev_cur_ordered_id, cmd->se_ordered_id); - }else if (cmd->sam_task_attr ==MSG_HEAD_TAG ) { + }else if (cmd->sam_task_attr ==TCM_HEAD_TAG ) { dev->dev_cur_ordered_id++;pr_debug ("Incremented dev_cur_ordered_id: %u for" " HEAD_OF_QUEUE: %u\n" , dev->dev_cur_ordered_id, cmd->se_ordered_id); - }else if (cmd->sam_task_attr ==MSG_ORDERED_TAG ) { + }else if (cmd->sam_task_attr ==TCM_ORDERED_TAG ) {atomic_dec_mb (&dev->dev_ordered_sync); dev->dev_cur_ordered_id++;
drivers/target/tcm_fc/tfc_cmd.c +4 -4
@@ -554,17 +554,17 @@ static void ft_send_work(struct work_struct *work)*/ switch (fcp->fc_pri_ta &FCP_PTA_MASK ) {case FCP_PTA_HEADQ : - task_attr =MSG_HEAD_TAG ; + task_attr =TCM_HEAD_TAG ;break ;case FCP_PTA_ORDERED : - task_attr =MSG_ORDERED_TAG ; + task_attr =TCM_ORDERED_TAG ;break ;case FCP_PTA_ACA : - task_attr =MSG_ACA_TAG ; + task_attr =TCM_ACA_TAG ;break ;case FCP_PTA_SIMPLE :/* Fallthrough */ default : - task_attr =MSG_SIMPLE_TAG ; + task_attr =TCM_SIMPLE_TAG ; }fc_seq_exch (cmd->seq)->lp->tt.seq_set_resp (cmd->seq, ft_recv_seq, cmd);
drivers/usb/gadget/legacy/tcm_usb_gadget.c +5 -5
@@ -1131,19 +1131,19 @@ static int usbg_submit_command(struct f_uas *fu,switch (cmd_iu->prio_attr &0x7 ) {case UAS_HEAD_TAG : - cmd->prio_attr =MSG_HEAD_TAG ; + cmd->prio_attr =TCM_HEAD_TAG ;break ;case UAS_ORDERED_TAG : - cmd->prio_attr =MSG_ORDERED_TAG ; + cmd->prio_attr =TCM_ORDERED_TAG ;break ;case UAS_ACA : - cmd->prio_attr =MSG_ACA_TAG ; + cmd->prio_attr =TCM_ACA_TAG ;break ;default :pr_debug_once ("Unsupported prio_attr: %02x.\n" , cmd_iu->prio_attr);case UAS_SIMPLE_TAG : - cmd->prio_attr =MSG_SIMPLE_TAG ; + cmd->prio_attr =TCM_SIMPLE_TAG ;break ; }
@@ -1240,7 +1240,7 @@ static int bot_submit_command(struct f_uas *fu, goto err; } - cmd->prio_attr =MSG_SIMPLE_TAG ; + cmd->prio_attr =TCM_SIMPLE_TAG ; se_cmd = &cmd->se_cmd; cmd->unpacked_lun = cbw->Lun; cmd->is_read = cbw->Flags &US_BULK_FLAG_IN ?1 :0 ;
drivers/xen/xen-scsiback.c +1 -1
@@ -606,7 +606,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req,init_waitqueue_head (&tmr->tmr_wait);transport_init_se_cmd (se_cmd, tpg->se_tpg.se_tpg_tfo, - tpg->tpg_nexus->tvn_se_sess,0 ,DMA_NONE ,MSG_SIMPLE_TAG , + tpg->tpg_nexus->tvn_se_sess,0 ,DMA_NONE ,TCM_SIMPLE_TAG , &pending_req->sense_buffer[0 ]); rc =core_tmr_alloc_req (se_cmd, tmr, act,GFP_KERNEL );
include/scsi/scsi_tcq.h +0 -5
@@ -6,11 +6,6 @@#include <scsi/scsi_device.h> #include <scsi/scsi_host.h> -#define MSG_SIMPLE_TAG 0x20 -#define MSG_HEAD_TAG 0x21 -#define MSG_ORDERED_TAG 0x22 -#define MSG_ACA_TAG 0x24/* unsupported */ -#define SCSI_NO_TAG (-1)/* identify no tag in use */
include/target/target_core_base.h +6 -0
@@ -476,6 +476,12 @@ struct se_dif_v1_tuple {__be32 ref_tag; }; +/* for sam_task_attr */ +#define TCM_SIMPLE_TAG 0x20 +#define TCM_HEAD_TAG 0x21 +#define TCM_ORDERED_TAG 0x22 +#define TCM_ACA_TAG 0x24 +struct se_cmd {/* SAM response code being sent to initiator */ u8 scsi_status;
include/trace/events/target.h +4 -4
@@ -109,10 +109,10 @@#define show_task_attribute_name (val) \ __print_symbolic(val, \ - { MSG_SIMPLE_TAG, "SIMPLE" }, \ - { MSG_HEAD_TAG, "HEAD" }, \ - { MSG_ORDERED_TAG, "ORDERED" }, \ - { MSG_ACA_TAG, "ACA" } ) + { TCM_SIMPLE_TAG, "SIMPLE" }, \ + { TCM_HEAD_TAG, "HEAD" }, \ + { TCM_ORDERED_TAG, "ORDERED" }, \ + { TCM_ACA_TAG, "ACA" } )#define show_scsi_status_name (val) \ __print_symbolic(val, \
Signature · 1 line
1.9.1
Re: [PATCH 4/4] scsi: remove scsi_set_tag_type
In reply to Christoph HellwigQuoted 1 line · Christoph Hellwig
There is no benefit over just setting
sdev->simple_tagsdirectly.
Re: [PATCH 2/4] scsi: never drop to untagged mode during queue ramp down
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
Dropping to untagged mode when ramping down a queue due to QUEUE FULL events has two problems:
- nothing in the midlayer or drivers ever moves back to tagged mode during queue ramp up.
-cmd_per_lunisn't the untagged queue depth for many modern drivers that can handle multiple untagged commands, and this is the only place in the midlayer assuming that.
Re: [PATCH 3/4] scsi: remove scsi_get_tag_type
In reply to Christoph HellwigQuoted 2 lines · Christoph Hellwig
Both remaining users are better of just checking
sdev->simple_tagsdirectly.
Bart Van Assche
maintainerRe: [PATCH 5/4] scsi: remove MSG_*_TAG defines
In reply to Christoph HellwigQuoted 25 lines · Christoph Hellwig
index 6719a33..2c5ce48 100644
drivers/scsi/advansys.c +3
-3@@ -7921,9 +7921,9 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,*/ if ((asc_dvc->cur_dvc_qng[scp->device->id] >0 ) && (boardp->reqcnt[scp->device->id] %255 ) ==0 ) { - asc_scsi_q->q2.tag_code =MSG_ORDERED_TAG ; + asc_scsi_q->q2.tag_code =ORDERED_QUEUE_TAG ; }else { - asc_scsi_q->q2.tag_code =MSG_SIMPLE_TAG ; + asc_scsi_q->q2.tag_code =SIMPLE_QUEUE_TAG ; }/* Build ASC_SCSI_Q */ @@ -8351,7 +8351,7 @@ static int AscPutReadyQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no) } q_addr =ASC_QNO_TO_QADDR (q_no);if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) ==0 ) { - scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; } scsiq->q1.status =QS_FREE ; AscMemWordCopyPtrToLram(iop_base,
drivers/scsi/advansys.c static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq) · line 8675
Quoted 8 lines
drivers/scsi/advansys.c +1
-1@@ -8669,7 +8669,7 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq) } }if (disable_syn_offset_one_fix) { - scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |ASC_TAG_FLAG_DISABLE_DISCONNECT ); }else {
One of the statements in advansys.c (tag_code &= 0xDC) makes assumptions about the numeric value of MSG_SIMPLE_TAG. This makes me wonder whether it is safe to change MSG_SIMPLE_TAG into another value ?
Bart.
Re: [PATCH 1/4] scsi: remove ->change_queue_type method
In reply to Christoph HellwigQuoted 4 lines · Christoph Hellwig
Since we got rid of ordered tag support in 2010 the prime use case of switching on and off ordered tags has been obsolete. The other function of enabling/dsiabling tagging entirely has only been correctly implemented by the 53c700 driver and isn't generally useful.
Re: [PATCH 5/4] scsi: remove MSG_*_TAG defines
In reply to Bart Van AsscheQuoted 10 lines · Bart Van Assche
drivers/scsi/advansys.c static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq) · line 8675
Quoted 6 lines
drivers/scsi/advansys.c +1
-1if (disable_syn_offset_one_fix) { - scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |ASC_TAG_FLAG_DISABLE_DISCONNECT ); }else {One of the statements in
advansys.c(tag_code&=0xDC) makes assumptions about the numeric value ofMSG_SIMPLE_TAG. This makes me wonder whether it is safe to changeMSG_SIMPLE_TAGinto another value ?
MSG_SIMPLE_TAG and SIMPLE_QUEUE_TAG are two different symbolic names for the 0x20 value assigned to the SCSI-2 protocol "SIMPLE QUEUE TAG" message. Having both is confusing, so I decided to only keep the one that is named closer to the spec, and in the same namespace as the symbolic names we use for other SCSI-2 messages.
Re: [PATCH 5/4] scsi: remove MSG_*_TAG defines
Quoted 12 lines · Christoph Hellwig
Quoted 10 lines · Bart Van Assche
drivers/scsi/advansys.c static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq) · line 8675
Quoted 6 lines
if (disable_syn_offset_one_fix) {drivers/scsi/advansys.c +1
-1- scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ; + scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG ; scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |ASC_TAG_FLAG_DISABLE_DISCONNECT ); }else {One of the statements in
advansys.c(tag_code&=0xDC) makes assumptions about the numeric value ofMSG_SIMPLE_TAG. This makes me wonder whether it is safe to changeMSG_SIMPLE_TAGinto another value ?
Quoted 5 lines
MSG_SIMPLE_TAGandSIMPLE_QUEUE_TAGare two different symbolic names for the0x20value assigned to the SCSI-2 protocol "SIMPLE QUEUE TAG" message. Having both is confusing, so I decided to only keep the one that is named closer to the spec, and in the same namespace as the symbolic names we use for other SCSI-2 messages.
Thanks for the clarification. Using different namespaces for symbolic constants for initiator and target drivers definitely looks like a good idea to me. The patch itself also looks fine to me. Hence:
Any chance to get another review for these to complete the queue depth / type changes for this merge window?
Quoted 8 lines · Christoph Hellwig
These are a few patches that follow up my previous cleanups for the queue depth and type handling.
The first patch removes the now pointless write support for the
queue_typesysfs attribute. The second changes the queue full tracking code to never drop out of tagged mode, as we can't recover from that, and the last two are random cleanups.
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
---end quoted text---
Re: [PATCH 1/4] scsi: remove ->change_queue_type method
In reply to Christoph HellwigQuoted 34 lines · Christoph Hellwig
Since we got rid of ordered tag support in 2010 the prime use case of switching on and off ordered tags has been obsolete. The other function of enabling/dsiabling tagging entirely has only been correctly implemented by the 53c700 driver and isn't generally useful.
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/infiniband/ulp/srp/ib_srp.c | 1 - drivers/scsi/53c700.c | 35 ----------------------------------- drivers/scsi/aic94xx/aic94xx_init.c | 1 - drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 - drivers/scsi/esas2r/esas2r_main.c | 1 - drivers/scsi/fcoe/fcoe.c | 1 - drivers/scsi/fnic/fnic_main.c | 1 - drivers/scsi/ibmvscsi/ibmvfc.c | 1 - drivers/scsi/ipr.c | 25 ------------------------- drivers/scsi/isci/init.c | 1 - drivers/scsi/libsas/sas_scsi_host.c | 8 -------- drivers/scsi/lpfc/lpfc_scsi.c | 2 -- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 1 - drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - drivers/scsi/pmcraid.c | 1 - drivers/scsi/qla2xxx/qla_os.c | 1 - drivers/scsi/scsi.c | 16 ---------------- drivers/scsi/scsi_debug.c | 27 --------------------------- drivers/scsi/scsi_sysfs.c | 30 ++++-------------------------- drivers/target/loopback/tcm_loop.c | 1 - include/scsi/libsas.h | 1 - include/scsi/scsi_host.h | 13 ------------- include/scsi/scsi_tcq.h | 3 --- 25 files changed, 4 insertions(+), 171 deletions(-)
[ .. ]
Quoted 40 lines
drivers/scsi/scsi_sysfs.c +4
-22@@ -738,30 +738,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {struct scsi_device *sdev =to_scsi_device (dev); -struct scsi_host_template *sht = sdev->host->hostt; -int tag_type =0 , retval; -int prev_tag_type =scsi_get_tag_type (sdev); - -if (!sdev->tagged_supported || !sht->change_queue_type) -return -EINVAL ; -/* -* We're never issueing order tags these days, but allow the value -* for backwards compatibility. -*/ -if (strncmp (buf,"ordered" ,7 ) ==0 || -strncmp (buf,"simple" ,6 ) ==0 ) - tag_type =MSG_SIMPLE_TAG ; -else if (strncmp (buf,"none" ,4 ) !=0 ) +if (!sdev->tagged_supported)return -EINVAL ; - -if (tag_type == prev_tag_type) -return count; - - retval = sht->change_queue_type (sdev, tag_type); -if (retval <0 ) -return retval; - + +sdev_printk (KERN_INFO , sdev, +"ignoring write to deprecated queue_type attribute" );return count; }
drivers/scsi/scsi_sysfs.c static umode_t scsi_sdev_attr_is_visible(struct kobject *kobj, · line 925
Quoted 10 lines
drivers/scsi/scsi_sysfs.c +0
-4@@ -938,10 +920,6 @@ static umode_t scsi_sdev_attr_is_visible(struct kobject *kobj, !sdev->host->hostt->change_queue_depth)return 0 ; -if (attr == &dev_attr_queue_type.attr && - !sdev->host->hostt->change_queue_type) -return S_IRUGO ; -return attr->mode; }
Why not setting the attribute to S_IRUGO always and drop the 'store' method altogether?
Otherwise:
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/4] scsi: never drop to untagged mode during queue ramp down
In reply to Christoph HellwigQuoted 22 lines · Christoph Hellwig
Dropping to untagged mode when ramping down a queue due to QUEUE FULL events has two problems:
- nothing in the midlayer or drivers ever moves back to tagged mode during queue ramp up.
-cmd_per_lunisn't the untagged queue depth for many modern drivers that can handle multiple untagged commands, and this is the only place in the midlayer assuming that.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/scsi.c | 6 ------ 1 file changed, 6 deletions(-)drivers/scsi/scsi.c +0
-0@@ -820,12 +820,6 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)if (sdev->last_queue_full_count <=10 )
drivers/scsi/scsi.c int scsi_track_queue_full(struct scsi_device *sdev, int depth) · line 825
Quoted 10 lines
drivers/scsi/scsi.c +0
-6return 0 ; -if (sdev->last_queue_full_depth <8 ) { -/* Drop back to untagged */ -scsi_set_tag_type (sdev,0 ); -scsi_change_queue_depth (sdev, sdev->host->cmd_per_lun); -return -1 ; - }return scsi_change_queue_depth (sdev, depth); }
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] scsi: remove scsi_get_tag_type
In reply to Christoph HellwigQuoted 4 lines · Christoph Hellwig
Both remaining users are better of just checking
sdev->simple_tagsdirectly.Signed-off-by Christoph Hellwig <[email protected]>
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] scsi: remove scsi_set_tag_type
In reply to Christoph HellwigQuoted 53 lines · Christoph Hellwig
There is no benefit over just setting
sdev->simple_tagsdirectly.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/53c700.c | 2 +- drivers/scsi/tmscsim.c | 2 +- include/scsi/scsi_tcq.h | 15 --------------- 3 files changed, 2 insertions(+), 17 deletions(-)drivers/scsi/53c700.c +1
-1@@ -902,8 +902,8 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata hostdata->tag_negotiated &= ~(1 <<scmd_id (SCp)); SCp->device->tagged_supported =0 ; + SCp->device->simple_tags =0 ;scsi_change_queue_depth (SCp->device, host->cmd_per_lun); -scsi_set_tag_type (SCp->device,0 ); }else { shost_printk(KERN_WARNING, host, "(%d:%d) Unexpected REJECT Message %s\n",drivers/scsi/tmscsim.c +1
-1@@ -2190,7 +2190,7 @@ static int dc390_slave_configure(struct scsi_device *sdev)* XXX: Note that while this driver used to called scsi_activate_tcq, * it never actually set a tag type, so emulate the old behavior. */ -scsi_set_tag_type (sdev,0 ); + sdev->simple_tags =0 ;if (sdev->tagged_supported && (dcb->DevMode &TAG_QUEUEING_ )) { dcb->SyncMode |=EN_TAG_QUEUEING ;include/scsi/scsi_tcq.h +0
-8@@ -15,21 +15,6 @@#ifdef CONFIG_BLOCK -static inline void scsi_set_tag_type (struct scsi_device *sdev,int tag) -{ -switch (tag) { -case MSG_ORDERED_TAG : -case MSG_SIMPLE_TAG : - sdev->simple_tags =1 ; -break ; -case 0 :
include/scsi/scsi_tcq.h line 20
Quoted 10 lines
include/scsi/scsi_tcq.h +0
-7-/* fall through */ -default : - sdev->simple_tags =0 ; -break ; - } -} -static inline struct scsi_cmnd *scsi_mq_find_tag (struct Scsi_Host *shost,int unique_tag) {
Probably needs to be adjusted now that's tmscsim is gone, but nevertheless:
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] scsi: remove ->change_queue_type method
In reply to Christoph HellwigQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> Since we got rid of ordered tag support in 2010 the prime use Christoph> case of switching on and off ordered tags has been obsolete. Christoph> The other function of enabling/dsiabling tagging entirely has Christoph> only been correctly implemented by the 53c700 driver and Christoph> isn't generally useful.
s/dsiabling/disabling/
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 2/4] scsi: never drop to untagged mode during queue ramp down
In reply to Christoph HellwigQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> Dropping to untagged mode when ramping down a queue due to Christoph> QUEUE FULL events has two problems:
Christoph> - nothing in the midlayer or drivers ever moves back to Christoph> tagged mode during queue ramp up. - cmd_per_lun isn't the Christoph> untagged queue depth for many modern drivers that can handle Christoph> multiple untagged commands, and this is the only place in the Christoph> midlayer assuming that.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 3/4] scsi: remove scsi_get_tag_type
In reply to Christoph HellwigQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> Both remaining users are better of just checking Christoph> sdev->simple_tags directly.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 4/4] scsi: remove scsi_set_tag_type
In reply to Christoph HellwigQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> There is no benefit over just setting sdev->simple_tags Christoph> directly.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
Reviewed-byRe: [PATCH 5/4] scsi: remove MSG_*_TAG defines
In reply to Christoph HellwigQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> For SPI drivers use the message defintions from scsi.c, and Christoph> for target drivers introduce a new TCM_*_TAG namespace.
s/defintions/definitions/
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 1/4] scsi: remove ->change_queue_type method
In reply to Hannes ReineckeQuoted 2 lines · Hannes Reinecke
Why not setting the attribute to
S_IRUGOalways and drop the 'store' method altogether?
For now I'm printing a warning if someone writes to it. I the long run we can simply mark it r/o.