Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2014 17:34:48 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268370 - head/sys/dev/iscsi
Message-ID:  <201407071734.s67HYmBW004710@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jul  7 17:34:48 2014
New Revision: 268370
URL: http://svnweb.freebsd.org/changeset/base/268370

Log:
  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.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Mon Jul  7 16:55:07 2014	(r268369)
+++ head/sys/dev/iscsi/iscsi.c	Mon Jul  7 17:34:48 2014	(r268370)
@@ -1341,7 +1341,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
 
 		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");
@@ -1960,23 +1960,24 @@ iscsi_action_scsiio(struct iscsi_session
 		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 = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun));
 	bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag;
@@ -2069,6 +2070,23 @@ iscsi_action(struct cam_sim *sim, union 
 		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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407071734.s67HYmBW004710>