* [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout
@ 2018-10-09 11:37 David Disseldorp
2018-10-09 13:56 ` Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David Disseldorp @ 2018-10-09 11:37 UTC (permalink / raw)
To: target-devel
sess_err_stats are currently filled on NOP ping timeout, but not
Data-Out timeout. Stash details of Data-Out timeouts using a
ISCSI_SESS_ERR_CXN_TIMEOUT value for last_sess_failure_type.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
drivers/target/iscsi/iscsi_target_erl1.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
index d75cc11ca83c..44ba50feae6d 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
@@ -1224,6 +1224,21 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
failure:
spin_unlock_bh(&cmd->dataout_timeout_lock);
+ {
+ struct iscsi_portal_group *tpg = conn->sess->tpg;
+ struct iscsi_tiqn *tiqn = tpg->tpg_tiqn;
+
+ if (tiqn) {
+ spin_lock_bh(&tiqn->sess_err_stats.lock);
+ strcpy(tiqn->sess_err_stats.last_sess_fail_rem_name,
+ conn->sess->sess_ops->InitiatorName);
+ tiqn->sess_err_stats.last_sess_failure_type + ISCSI_SESS_ERR_CXN_TIMEOUT;
+ tiqn->sess_err_stats.cxn_timeout_errors++;
+ atomic_long_inc(&conn->sess->conn_timeout_errors);
+ spin_unlock_bh(&tiqn->sess_err_stats.lock);
+ }
+ }
iscsit_cause_connection_reinstatement(conn, 0);
iscsit_dec_conn_usage_count(conn);
}
--
2.13.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout
2018-10-09 11:37 [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout David Disseldorp
@ 2018-10-09 13:56 ` Bart Van Assche
2018-10-09 14:04 ` David Disseldorp
2018-10-09 15:45 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-10-09 13:56 UTC (permalink / raw)
To: target-devel
On 10/9/18 4:37 AM, David Disseldorp wrote:
> failure:
> spin_unlock_bh(&cmd->dataout_timeout_lock);
> + {
> + struct iscsi_portal_group *tpg = conn->sess->tpg;
> + struct iscsi_tiqn *tiqn = tpg->tpg_tiqn;
> +
> + if (tiqn) {
> + spin_lock_bh(&tiqn->sess_err_stats.lock);
> + strcpy(tiqn->sess_err_stats.last_sess_fail_rem_name,
> + conn->sess->sess_ops->InitiatorName);
> + tiqn->sess_err_stats.last_sess_failure_type > + ISCSI_SESS_ERR_CXN_TIMEOUT;
> + tiqn->sess_err_stats.cxn_timeout_errors++;
> + atomic_long_inc(&conn->sess->conn_timeout_errors);
> + spin_unlock_bh(&tiqn->sess_err_stats.lock);
> + }
> + }
> iscsit_cause_connection_reinstatement(conn, 0);
> iscsit_dec_conn_usage_count(conn);
> }
Please introduce a helper function instead of not indenting a nested
code block.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout
2018-10-09 11:37 [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout David Disseldorp
2018-10-09 13:56 ` Bart Van Assche
@ 2018-10-09 14:04 ` David Disseldorp
2018-10-09 15:45 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: David Disseldorp @ 2018-10-09 14:04 UTC (permalink / raw)
To: target-devel
On Tue, 9 Oct 2018 06:56:29 -0700, Bart Van Assche wrote:
> Please introduce a helper function instead of not indenting a nested
> code block.
Will do in the next round. Thanks for the feedback.
Cheers, David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout
2018-10-09 11:37 [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout David Disseldorp
2018-10-09 13:56 ` Bart Van Assche
2018-10-09 14:04 ` David Disseldorp
@ 2018-10-09 15:45 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2018-10-09 15:45 UTC (permalink / raw)
To: target-devel
On 10/09/2018 06:37 AM, David Disseldorp wrote:
> sess_err_stats are currently filled on NOP ping timeout, but not
> Data-Out timeout. Stash details of Data-Out timeouts using a
> ISCSI_SESS_ERR_CXN_TIMEOUT value for last_sess_failure_type.
>
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---
> drivers/target/iscsi/iscsi_target_erl1.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
> index d75cc11ca83c..44ba50feae6d 100644
> --- a/drivers/target/iscsi/iscsi_target_erl1.c
> +++ b/drivers/target/iscsi/iscsi_target_erl1.c
> @@ -1224,6 +1224,21 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
>
> failure:
> spin_unlock_bh(&cmd->dataout_timeout_lock);
> + {
> + struct iscsi_portal_group *tpg = conn->sess->tpg;
> + struct iscsi_tiqn *tiqn = tpg->tpg_tiqn;
> +
> + if (tiqn) {
> + spin_lock_bh(&tiqn->sess_err_stats.lock);
> + strcpy(tiqn->sess_err_stats.last_sess_fail_rem_name,
> + conn->sess->sess_ops->InitiatorName);
> + tiqn->sess_err_stats.last_sess_failure_type > + ISCSI_SESS_ERR_CXN_TIMEOUT;
> + tiqn->sess_err_stats.cxn_timeout_errors++;
> + atomic_long_inc(&conn->sess->conn_timeout_errors);
> + spin_unlock_bh(&tiqn->sess_err_stats.lock);
It looks like this keeps getting copied. Check out
iscsit_handle_time2retain_timeout and
iscsit_handle_nopin_response_timeout. Just make it a function and call
it everywhere.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-09 15:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 11:37 [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout David Disseldorp
2018-10-09 13:56 ` Bart Van Assche
2018-10-09 14:04 ` David Disseldorp
2018-10-09 15:45 ` Mike Christie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.