From: Mike Christie <mchristi@redhat.com>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH 3/4] target: stash sess_err_stats on Data-Out timeout
Date: Tue, 09 Oct 2018 15:45:57 +0000 [thread overview]
Message-ID: <5BBCCD35.5030207@redhat.com> (raw)
In-Reply-To: <20181009113706.27696-4-ddiss@suse.de>
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.
prev parent reply other threads:[~2018-10-09 15:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5BBCCD35.5030207@redhat.com \
--to=mchristi@redhat.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.