aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_tpc.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2014-11-25 17:53:35 +0000
committerAlexander Motin <mav@FreeBSD.org>2014-11-25 17:53:35 +0000
commitf7241cceb02f56add7f4a504021069acb81f4bf6 (patch)
treea3a596368ccfcff50a172e691d7ebad9c8822de3 /sys/cam/ctl/ctl_tpc.c
parent82e843b93b2ce12c8cf5c1fd5fb88c1d37a54134 (diff)
downloadsrc-f7241cceb02f56add7f4a504021069acb81f4bf6.tar.gz
src-f7241cceb02f56add7f4a504021069acb81f4bf6.zip
Coalesce last data move and command status for read commands.
Make CTL core and block backend set success status before initiating last data move for read commands. Make CAM target and iSCSI frontends detect such condition and send command status together with data. New I/O flag allows to skip duplicate status sending on later fe_done() call. For Fibre Channel this change saves one of three interrupts per read command, increasing performance from 126K to 160K IOPS. For iSCSI this change saves one of three PDUs per read command, increasing performance from 1M to 1.2M IOPS. MFC after: 1 month Sponsored by: iXsystems, Inc.
Notes
Notes: svn path=/head/; revision=275058
Diffstat (limited to 'sys/cam/ctl/ctl_tpc.c')
-rw-r--r--sys/cam/ctl/ctl_tpc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index f7648a072ac7..c715f877a0af 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -425,7 +425,7 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len)
gco_ptr->data_segment_granularity = 0;
gco_ptr->inline_data_granularity = 0;
- ctsio->scsi_status = SCSI_STATUS_OK;
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
ctl_datamove((union ctl_io *)ctsio);
@@ -487,9 +487,9 @@ ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio)
data->list_of_implemented_descriptor_type_codes[2] = EC_SEG_REGISTER_KEY;
data->list_of_implemented_descriptor_type_codes[3] = EC_CSCD_ID;
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
@@ -584,9 +584,9 @@ ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio)
scsi_ulto4b(list_copy.curbytes >> 20, data->transfer_count);
}
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
@@ -656,9 +656,9 @@ ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio)
scsi_ulto2b(list_copy.sense_len, data->sense_data_length);
memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len);
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
@@ -742,9 +742,9 @@ ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio)
data->sense_data_length = list_copy.sense_len;
memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len);
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
@@ -1482,8 +1482,6 @@ tpc_done(union ctl_io *io)
* more sophisticated initiator type behavior, the CAM error
* recovery code in ../common might be helpful.
*/
-// if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)
-// ctl_io_error_print(io, NULL);
tio = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)
&& (io->io_hdr.retries > 0)) {
@@ -2168,9 +2166,9 @@ ctl_receive_rod_token_information(struct ctl_scsiio *ctsio)
printf("RRTI(list=%u) valid=%d\n",
scsi_4btoul(cdb->list_identifier), list_copy.res_token_valid);
*/
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
@@ -2234,9 +2232,9 @@ ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio)
/*
printf("RART tokens=%d\n", i);
*/
+ ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
ctsio->be_move_done = ctl_config_move_done;
-
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}