changeset 12947:c7112a30cb32

6953251 Comstar iscsi target cannot work with Starport iscsi initiator 6952103 COMSTAR iscsit ignores negotiated numerical values that are clipped to the target limit
author Peter Gill <Peter.Gill@Sun.COM>
date Wed, 28 Jul 2010 13:12:37 -0400
parents e1720225a6de
children ea5597b82cd8
files usr/src/uts/common/io/comstar/port/iscsit/iscsit.h usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c usr/src/uts/common/io/ib/clients/iser/iser_idm.c
diffstat 3 files changed, 23 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit.h	Wed Jul 28 13:07:36 2010 -0400
+++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit.h	Wed Jul 28 13:12:37 2010 -0400
@@ -38,9 +38,9 @@
 #define	ISCSIT_MAX_VERSION			0x00
 #define	ISCSIT_MAX_CONNECTIONS			32 /* MC/S support  */
 #define	ISCSIT_MAX_RECV_DATA_SEGMENT_LENGTH	(32*1024)
-#define	ISCSIT_MAX_BURST_LENGTH			(512*1024)
+#define	ISCSIT_MAX_BURST_LENGTH			(1024*1024)
 #define	ISCSIT_MAX_FIRST_BURST_LENGTH		ISCSI_DEFAULT_FIRST_BURST_LENGTH
-#define	ISCSIT_MAX_TIME2WAIT			ISCSI_DEFAULT_TIME_TO_WAIT
+#define	ISCSIT_MAX_TIME2WAIT			ISCSI_MAX_TIME2WAIT
 #define	ISCSIT_MAX_TIME2RETAIN			ISCSI_DEFAULT_TIME_TO_RETAIN
 #define	ISCSIT_MAX_OUTSTANDING_R2T		ISCSI_DEFAULT_MAX_OUT_R2T
 #define	ISCSIT_MAX_ERROR_RECOVERY_LEVEL		0
--- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c	Wed Jul 28 13:07:36 2010 -0400
+++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_login.c	Wed Jul 28 13:12:37 2010 -0400
@@ -2481,8 +2481,10 @@
 		if (value != iscsit_value) {
 			/* Respond back to initiator with our value */
 			value = iscsit_value;
+			nvrc = nvlist_add_boolean_value(
+			    lsm->icl_negotiated_values,
+			    ikvx->ik_key_name, value);
 			lsm->icl_login_transit = B_FALSE;
-			nvrc = 0;
 		} else {
 			/* Add this to our negotiated values */
 			nvrc = nvlist_add_nvpair(lsm->icl_negotiated_values,
@@ -2521,8 +2523,9 @@
 		if (value > iscsit_max_value) {
 			/* Respond back to initiator with our value */
 			value = iscsit_max_value;
+			nvrc = nvlist_add_uint64(lsm->icl_negotiated_values,
+			    ikvx->ik_key_name, value);
 			lsm->icl_login_transit = B_FALSE;
-			nvrc = 0;
 		} else {
 			/* Add this to our negotiated values */
 			nvrc = nvlist_add_nvpair(lsm->icl_negotiated_values,
--- a/usr/src/uts/common/io/ib/clients/iser/iser_idm.c	Wed Jul 28 13:07:36 2010 -0400
+++ b/usr/src/uts/common/io/ib/clients/iser/iser_idm.c	Wed Jul 28 13:12:37 2010 -0400
@@ -701,9 +701,9 @@
     boolean_t iser_value, nvlist_t *request_nvl, nvlist_t *response_nvl,
     nvlist_t *negotiated_nvl)
 {
-	kv_status_t		kvrc;
+	kv_status_t		kvrc = KV_UNHANDLED;
 	int			nvrc;
-	boolean_t		respond;
+	boolean_t		respond = B_FALSE;
 
 	if (value != iser_value) {
 		/*
@@ -711,9 +711,12 @@
 		 * set the return value to unset the transit bit.
 		 */
 		value = iser_value;
-		kvrc = KV_HANDLED_NO_TRANSIT;
-		nvrc = 0;
-		respond = B_TRUE;
+		nvrc = nvlist_add_boolean_value(negotiated_nvl,
+		    ikvx->ik_key_name, value);
+		if (nvrc == 0) {
+			kvrc = KV_HANDLED_NO_TRANSIT;
+			respond = B_TRUE;
+		}
 
 	} else {
 		/* Add this to our negotiated values */
@@ -747,9 +750,9 @@
     uint64_t min_value, uint64_t max_value, uint64_t iser_max_value,
     nvlist_t *request_nvl, nvlist_t *response_nvl, nvlist_t *negotiated_nvl)
 {
-	kv_status_t		kvrc;
+	kv_status_t		kvrc = KV_UNHANDLED;
 	int			nvrc;
-	boolean_t		respond;
+	boolean_t		respond = B_FALSE;
 
 	/* Validate against standard */
 	if ((value < min_value) || (value > max_value)) {
@@ -761,9 +764,12 @@
 			 * set the return value to unset the transit bit.
 			 */
 			value = iser_max_value;
-			kvrc = KV_HANDLED_NO_TRANSIT;
-			nvrc = 0;
-			respond = B_TRUE;
+			nvrc = nvlist_add_uint64(negotiated_nvl,
+			    ikvx->ik_key_name, value);
+			if (nvrc == 0) {
+				kvrc = KV_HANDLED_NO_TRANSIT;
+				respond = B_TRUE;
+			}
 		} else {
 			/* Add this to our negotiated values */
 			nvrc = nvlist_add_nvpair(negotiated_nvl, nvp);