iscsi: Change the type of some negotiation params from uint32_t to bool
ImmediateData in negotation parameters can be controlled by the config file and currently "Yes" or "No" are valid values of it in the config file. "Yes" or "No" means almost bool. Additionally, ImmediateData is defined as boolean value in the iSCSI specification as follows. However ImmediateData is an uint32_t variable and 0 or 1 are used in SPDK now. In the upcoming JSON config file, boolean value should be set to ImmediateData. Hence change all variables and constants related with ImmediateData to boolean in this patch. InitialR2T, DataPDUInOrder, and DataSequenceInOrder are not controllable by the config file but these are defined as boolean value in the iSCSI specification. Hence change them to bool too. Besides, AllowDuplicateIsid is used almost as boolean value. Hence change it to bool too. InitialR2T=<boolean-value> ImmediateData=<boolean-value> DataPDUInOrder=<boolean-value> DataSequenceInOrder=<boolean-value> Change-Id: I9f98b219687b3600194563b1d6b85551f4586144 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403237 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
7315fa5ab6
commit
372c5e1ec7
@ -70,10 +70,10 @@
|
|||||||
#define DEFAULT_DEFAULTTIME2WAIT 2
|
#define DEFAULT_DEFAULTTIME2WAIT 2
|
||||||
#define DEFAULT_DEFAULTTIME2RETAIN 20
|
#define DEFAULT_DEFAULTTIME2RETAIN 20
|
||||||
#define DEFAULT_FIRSTBURSTLENGTH 8192
|
#define DEFAULT_FIRSTBURSTLENGTH 8192
|
||||||
#define DEFAULT_INITIALR2T 1
|
#define DEFAULT_INITIALR2T true
|
||||||
#define DEFAULT_IMMEDIATEDATA 1
|
#define DEFAULT_IMMEDIATEDATA true
|
||||||
#define DEFAULT_DATAPDUINORDER 1
|
#define DEFAULT_DATAPDUINORDER true
|
||||||
#define DEFAULT_DATASEQUENCEINORDER 1
|
#define DEFAULT_DATASEQUENCEINORDER true
|
||||||
#define DEFAULT_ERRORRECOVERYLEVEL 0
|
#define DEFAULT_ERRORRECOVERYLEVEL 0
|
||||||
#define DEFAULT_TIMEOUT 60
|
#define DEFAULT_TIMEOUT 60
|
||||||
#define MAX_NOPININTERVAL 60
|
#define MAX_NOPININTERVAL 60
|
||||||
@ -244,10 +244,10 @@ struct spdk_iscsi_sess {
|
|||||||
uint32_t DefaultTime2Retain;
|
uint32_t DefaultTime2Retain;
|
||||||
uint32_t FirstBurstLength;
|
uint32_t FirstBurstLength;
|
||||||
uint32_t MaxBurstLength;
|
uint32_t MaxBurstLength;
|
||||||
uint32_t InitialR2T;
|
bool InitialR2T;
|
||||||
uint32_t ImmediateData;
|
bool ImmediateData;
|
||||||
uint32_t DataPDUInOrder;
|
bool DataPDUInOrder;
|
||||||
uint32_t DataSequenceInOrder;
|
bool DataSequenceInOrder;
|
||||||
uint32_t ErrorRecoveryLevel;
|
uint32_t ErrorRecoveryLevel;
|
||||||
|
|
||||||
uint32_t ExpCmdSN;
|
uint32_t ExpCmdSN;
|
||||||
@ -279,9 +279,9 @@ struct spdk_iscsi_opts {
|
|||||||
uint32_t MaxQueueDepth;
|
uint32_t MaxQueueDepth;
|
||||||
uint32_t DefaultTime2Wait;
|
uint32_t DefaultTime2Wait;
|
||||||
uint32_t DefaultTime2Retain;
|
uint32_t DefaultTime2Retain;
|
||||||
uint32_t ImmediateData;
|
bool ImmediateData;
|
||||||
uint32_t ErrorRecoveryLevel;
|
uint32_t ErrorRecoveryLevel;
|
||||||
uint32_t AllowDuplicateIsid;
|
bool AllowDuplicateIsid;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_iscsi_globals {
|
struct spdk_iscsi_globals {
|
||||||
@ -306,9 +306,9 @@ struct spdk_iscsi_globals {
|
|||||||
uint32_t MaxQueueDepth;
|
uint32_t MaxQueueDepth;
|
||||||
uint32_t DefaultTime2Wait;
|
uint32_t DefaultTime2Wait;
|
||||||
uint32_t DefaultTime2Retain;
|
uint32_t DefaultTime2Retain;
|
||||||
uint32_t ImmediateData;
|
bool ImmediateData;
|
||||||
uint32_t ErrorRecoveryLevel;
|
uint32_t ErrorRecoveryLevel;
|
||||||
uint32_t AllowDuplicateIsid;
|
bool AllowDuplicateIsid;
|
||||||
|
|
||||||
struct spdk_mempool *pdu_pool;
|
struct spdk_mempool *pdu_pool;
|
||||||
struct spdk_mempool *pdu_immediate_data_pool;
|
struct spdk_mempool *pdu_immediate_data_pool;
|
||||||
|
@ -111,7 +111,7 @@ spdk_iscsi_config_dump_section(FILE *fp)
|
|||||||
g_spdk_iscsi.MaxConnections,
|
g_spdk_iscsi.MaxConnections,
|
||||||
g_spdk_iscsi.MaxQueueDepth,
|
g_spdk_iscsi.MaxQueueDepth,
|
||||||
g_spdk_iscsi.DefaultTime2Wait, g_spdk_iscsi.DefaultTime2Retain,
|
g_spdk_iscsi.DefaultTime2Wait, g_spdk_iscsi.DefaultTime2Retain,
|
||||||
(g_spdk_iscsi.ImmediateData == 1) ? "Yes" : "No",
|
(g_spdk_iscsi.ImmediateData) ? "Yes" : "No",
|
||||||
g_spdk_iscsi.ErrorRecoveryLevel);
|
g_spdk_iscsi.ErrorRecoveryLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ spdk_iscsi_opts_init(struct spdk_iscsi_opts *opts)
|
|||||||
opts->DefaultTime2Wait = DEFAULT_DEFAULTTIME2WAIT;
|
opts->DefaultTime2Wait = DEFAULT_DEFAULTTIME2WAIT;
|
||||||
opts->DefaultTime2Retain = DEFAULT_DEFAULTTIME2RETAIN;
|
opts->DefaultTime2Retain = DEFAULT_DEFAULTTIME2RETAIN;
|
||||||
opts->ImmediateData = DEFAULT_IMMEDIATEDATA;
|
opts->ImmediateData = DEFAULT_IMMEDIATEDATA;
|
||||||
opts->AllowDuplicateIsid = 0;
|
opts->AllowDuplicateIsid = false;
|
||||||
opts->ErrorRecoveryLevel = DEFAULT_ERRORRECOVERYLEVEL;
|
opts->ErrorRecoveryLevel = DEFAULT_ERRORRECOVERYLEVEL;
|
||||||
opts->timeout = DEFAULT_TIMEOUT;
|
opts->timeout = DEFAULT_TIMEOUT;
|
||||||
opts->nopininterval = DEFAULT_NOPININTERVAL;
|
opts->nopininterval = DEFAULT_NOPININTERVAL;
|
||||||
|
@ -1163,10 +1163,10 @@ spdk_iscsi_copy_param2var(struct spdk_iscsi_conn *conn)
|
|||||||
}
|
}
|
||||||
if (strcasecmp(val, "Yes") == 0) {
|
if (strcasecmp(val, "Yes") == 0) {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set InitialR2T=1\n");
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set InitialR2T=1\n");
|
||||||
conn->sess->InitialR2T = 1;
|
conn->sess->InitialR2T = true;
|
||||||
} else {
|
} else {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set InitialR2T=0\n");
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set InitialR2T=0\n");
|
||||||
conn->sess->InitialR2T = 0;
|
conn->sess->InitialR2T = false;
|
||||||
}
|
}
|
||||||
val = spdk_iscsi_param_get_val(conn->sess->params, "ImmediateData");
|
val = spdk_iscsi_param_get_val(conn->sess->params, "ImmediateData");
|
||||||
if (val == NULL) {
|
if (val == NULL) {
|
||||||
@ -1175,10 +1175,10 @@ spdk_iscsi_copy_param2var(struct spdk_iscsi_conn *conn)
|
|||||||
}
|
}
|
||||||
if (strcasecmp(val, "Yes") == 0) {
|
if (strcasecmp(val, "Yes") == 0) {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set ImmediateData=1\n");
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set ImmediateData=1\n");
|
||||||
conn->sess->ImmediateData = 1;
|
conn->sess->ImmediateData = true;
|
||||||
} else {
|
} else {
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set ImmediateData=0\n");
|
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "set ImmediateData=0\n");
|
||||||
conn->sess->ImmediateData = 0;
|
conn->sess->ImmediateData = false;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ burst_length_param_negotation(int FirstBurstLength, int MaxBurstLength,
|
|||||||
sess.session_type = SESSION_TYPE_NORMAL;
|
sess.session_type = SESSION_TYPE_NORMAL;
|
||||||
sess.params = NULL;
|
sess.params = NULL;
|
||||||
sess.MaxBurstLength = 65536;
|
sess.MaxBurstLength = 65536;
|
||||||
sess.InitialR2T = 1;
|
sess.InitialR2T = true;
|
||||||
sess.FirstBurstLength = SPDK_ISCSI_FIRST_BURST_LENGTH;
|
sess.FirstBurstLength = SPDK_ISCSI_FIRST_BURST_LENGTH;
|
||||||
sess.MaxOutstandingR2T = 1;
|
sess.MaxOutstandingR2T = 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user