summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-07-15 18:22:17 +0000
committermav <mav@FreeBSD.org>2014-07-15 18:22:17 +0000
commitb47c885e2c2f7c13d123cc7a1363a50373f2961c (patch)
treefdb30c2f6a905d0a69d603f106ed3c4685707ca8 /sys/dev/iscsi
parente6aad795782ef4a872f748ad09e30f70235ba942 (diff)
downloadFreeBSD-src-b47c885e2c2f7c13d123cc7a1363a50373f2961c.zip
FreeBSD-src-b47c885e2c2f7c13d123cc7a1363a50373f2961c.tar.gz
MFC r268370:
Make XPT_GET_TRAN_SETTINGS to report CAM that command queueing is enabled, but make couple changes to handle non-queued commands too, if happen.
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/iscsi.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index 0a75838..b9c8c9f 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1346,7 +1346,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
is->is_sim = cam_sim_alloc(iscsi_action, iscsi_poll, "iscsi",
is, is->is_id /* unit */, &is->is_lock,
- maxtags, maxtags, is->is_devq);
+ 1, maxtags, is->is_devq);
if (is->is_sim == NULL) {
ISCSI_SESSION_UNLOCK(is);
ISCSI_SESSION_WARN(is, "failed to allocate SIM");
@@ -1948,23 +1948,24 @@ iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb)
break;
}
- switch (csio->tag_action) {
- case MSG_HEAD_OF_Q_TAG:
- bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ;
- break;
- break;
- case MSG_ORDERED_Q_TAG:
- bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED;
- break;
- case MSG_ACA_TASK:
- bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA;
- break;
- case CAM_TAG_ACTION_NONE:
- case MSG_SIMPLE_Q_TAG:
- default:
- bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE;
- break;
- }
+ if ((ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) != 0) {
+ switch (csio->tag_action) {
+ case MSG_HEAD_OF_Q_TAG:
+ bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ;
+ break;
+ case MSG_ORDERED_Q_TAG:
+ bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED;
+ break;
+ case MSG_ACA_TASK:
+ bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA;
+ break;
+ case MSG_SIMPLE_Q_TAG:
+ default:
+ bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE;
+ break;
+ }
+ } else
+ bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_UNTAGGED;
bhssc->bhssc_lun = iscsi_encode_lun(csio->ccb_h.target_lun);
bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag;
@@ -2059,6 +2060,23 @@ iscsi_action(struct cam_sim *sim, union ccb *ccb)
cpi->ccb_h.status = CAM_REQ_CMP;
break;
}
+ case XPT_GET_TRAN_SETTINGS:
+ {
+ struct ccb_trans_settings *cts;
+ struct ccb_trans_settings_scsi *scsi;
+
+ cts = &ccb->cts;
+ scsi = &cts->proto_specific.scsi;
+
+ cts->protocol = PROTO_SCSI;
+ cts->protocol_version = SCSI_REV_SPC3;
+ cts->transport = XPORT_ISCSI;
+ cts->transport_version = 0;
+ scsi->valid = CTS_SCSI_VALID_TQ;
+ scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
+ cts->ccb_h.status = CAM_REQ_CMP;
+ break;
+ }
case XPT_CALC_GEOMETRY:
cam_calc_geometry(&ccb->ccg, /*extended*/1);
ccb->ccb_h.status = CAM_REQ_CMP;
OpenPOWER on IntegriCloud