Commit f6d5180c authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] libiscsi: fix nop handling

During root boot and shutdown the target could send us nops.
At this time iscsid cannot be running, so the target will drop
the session and the boot or shutdown will hang.

To handle this and allow us to better control when to check the network
this patch moves the nop handling to the kernel.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 26974789
...@@ -577,7 +577,9 @@ static struct iscsi_transport iscsi_iser_transport = { ...@@ -577,7 +577,9 @@ static struct iscsi_transport iscsi_iser_transport = {
ISCSI_PERSISTENT_ADDRESS | ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME | ISCSI_TPGT | ISCSI_TARGET_NAME | ISCSI_TPGT |
ISCSI_USERNAME | ISCSI_PASSWORD | ISCSI_USERNAME | ISCSI_PASSWORD |
ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN, ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
ISCSI_PING_TMO | ISCSI_RECV_TMO,
.host_param_mask = ISCSI_HOST_HWADDRESS | .host_param_mask = ISCSI_HOST_HWADDRESS |
ISCSI_HOST_NETDEV_NAME | ISCSI_HOST_NETDEV_NAME |
ISCSI_HOST_INITIATOR_NAME, ISCSI_HOST_INITIATOR_NAME,
......
...@@ -2246,7 +2246,9 @@ static struct iscsi_transport iscsi_tcp_transport = { ...@@ -2246,7 +2246,9 @@ static struct iscsi_transport iscsi_tcp_transport = {
ISCSI_TARGET_NAME | ISCSI_TPGT | ISCSI_TARGET_NAME | ISCSI_TPGT |
ISCSI_USERNAME | ISCSI_PASSWORD | ISCSI_USERNAME | ISCSI_PASSWORD |
ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
ISCSI_FAST_ABORT, ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
ISCSI_LU_RESET_TMO |
ISCSI_PING_TMO | ISCSI_RECV_TMO,
.host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS |
ISCSI_HOST_INITIATOR_NAME | ISCSI_HOST_INITIATOR_NAME |
ISCSI_HOST_NETDEV_NAME, ISCSI_HOST_NETDEV_NAME,
......
This diff is collapsed.
...@@ -1202,6 +1202,8 @@ iscsi_conn_attr(port, ISCSI_PARAM_CONN_PORT); ...@@ -1202,6 +1202,8 @@ iscsi_conn_attr(port, ISCSI_PARAM_CONN_PORT);
iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN); iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN);
iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS); iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS);
iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS); iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS);
iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO);
iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO);
#define iscsi_cdev_to_session(_cdev) \ #define iscsi_cdev_to_session(_cdev) \
iscsi_dev_to_session(_cdev->dev) iscsi_dev_to_session(_cdev->dev)
...@@ -1437,6 +1439,8 @@ iscsi_register_transport(struct iscsi_transport *tt) ...@@ -1437,6 +1439,8 @@ iscsi_register_transport(struct iscsi_transport *tt)
SETUP_CONN_RD_ATTR(exp_statsn, ISCSI_EXP_STATSN); SETUP_CONN_RD_ATTR(exp_statsn, ISCSI_EXP_STATSN);
SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS); SETUP_CONN_RD_ATTR(persistent_address, ISCSI_PERSISTENT_ADDRESS);
SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT); SETUP_CONN_RD_ATTR(persistent_port, ISCSI_PERSISTENT_PORT);
SETUP_CONN_RD_ATTR(ping_tmo, ISCSI_PING_TMO);
SETUP_CONN_RD_ATTR(recv_tmo, ISCSI_RECV_TMO);
BUG_ON(count > ISCSI_CONN_ATTRS); BUG_ON(count > ISCSI_CONN_ATTRS);
priv->conn_attrs[count] = NULL; priv->conn_attrs[count] = NULL;
......
...@@ -244,6 +244,12 @@ enum iscsi_param { ...@@ -244,6 +244,12 @@ enum iscsi_param {
ISCSI_PARAM_PASSWORD_IN, ISCSI_PARAM_PASSWORD_IN,
ISCSI_PARAM_FAST_ABORT, ISCSI_PARAM_FAST_ABORT,
ISCSI_PARAM_ABORT_TMO,
ISCSI_PARAM_LU_RESET_TMO,
ISCSI_PARAM_HOST_RESET_TMO,
ISCSI_PARAM_PING_TMO,
ISCSI_PARAM_RECV_TMO,
/* must always be last */ /* must always be last */
ISCSI_PARAM_MAX, ISCSI_PARAM_MAX,
}; };
...@@ -275,6 +281,11 @@ enum iscsi_param { ...@@ -275,6 +281,11 @@ enum iscsi_param {
#define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD) #define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD)
#define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN) #define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN)
#define ISCSI_FAST_ABORT (1 << ISCSI_PARAM_FAST_ABORT) #define ISCSI_FAST_ABORT (1 << ISCSI_PARAM_FAST_ABORT)
#define ISCSI_ABORT_TMO (1 << ISCSI_PARAM_ABORT_TMO)
#define ISCSI_LU_RESET_TMO (1 << ISCSI_PARAM_LU_RESET_TMO)
#define ISCSI_HOST_RESET_TMO (1 << ISCSI_PARAM_HOST_RESET_TMO)
#define ISCSI_PING_TMO (1 << ISCSI_PARAM_PING_TMO)
#define ISCSI_RECV_TMO (1 << ISCSI_PARAM_RECV_TMO)
/* iSCSI HBA params */ /* iSCSI HBA params */
enum iscsi_host_param { enum iscsi_host_param {
......
...@@ -148,6 +148,12 @@ struct iscsi_conn { ...@@ -148,6 +148,12 @@ struct iscsi_conn {
* conn_stop() flag: stop to recover, stop to terminate * conn_stop() flag: stop to recover, stop to terminate
*/ */
int stop_stage; int stop_stage;
struct timer_list transport_timer;
unsigned long last_recv;
unsigned long last_ping;
int ping_timeout;
int recv_timeout;
struct iscsi_mgmt_task *ping_mtask;
/* iSCSI connection-wide sequencing */ /* iSCSI connection-wide sequencing */
uint32_t exp_statsn; uint32_t exp_statsn;
...@@ -238,6 +244,8 @@ struct iscsi_session { ...@@ -238,6 +244,8 @@ struct iscsi_session {
uint32_t queued_cmdsn; uint32_t queued_cmdsn;
/* configuration */ /* configuration */
int abort_timeout;
int lu_reset_timeout;
int initial_r2t_en; int initial_r2t_en;
unsigned max_r2t; unsigned max_r2t;
int imm_data_en; int imm_data_en;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment