From nobody Fri Apr 29 23:12:34 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB8391ABCAF0; Fri, 29 Apr 2022 23:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KqpDL3YF2z3w5T; Fri, 29 Apr 2022 23:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651273954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SqCpQko5+Nnsms9ZT+brGU3ZGoSWJRyna3rJdOR01Ho=; b=H+KcFuijpQ3VxADJUh9pkWQlr+pottrWv5iroNMBVTFhoF0iB6WEeI8tC5FpBBIau13+c1 qffhCsPv2imfJJvypytZC4/gs5pyJQniWSUW70a/fFZZEY0VRpkZizQGXaVocmIkY+LHcz aX0b+tiIe6/V/ktaQ0r5Y0JNO4gnKYEoIAK2FcmfUp5LJuc7OFBNPzJH0uP+Rjmb08Z8dQ QBCzWqmR8S3+CwbAw5kUhxaQW0RFhZ0XHk1lPfq5OvFs0JnwuLONvczVWA36eufLZuzC1/ ieW4/FWSeoZlL2M2sLb8Aapd1CyhKmLpUUJozjALrvoTo+Ln2lLGWlT5knWqkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3599E15FBF; Fri, 29 Apr 2022 23:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23TNCYDr044823; Fri, 29 Apr 2022 23:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23TNCYta044822; Fri, 29 Apr 2022 23:12:34 GMT (envelope-from git) Date: Fri, 29 Apr 2022 23:12:34 GMT Message-Id: <202204292312.23TNCYta044822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6a435d581fe2 - stable/13 - iscsi: Abort fewer data-out tasks on a terminating session. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a435d581fe2e7e1d0f05bc402ac5063898526f7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651273954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SqCpQko5+Nnsms9ZT+brGU3ZGoSWJRyna3rJdOR01Ho=; b=yHZA78EofAcSs+v+leWzQVUcUfpK2oSluP+MqeRJOZ7TFxvAbHiBfqHg41mTStryh/mDKg YqwiEojns7Ua15kQ36746OSnYCGPruGkihdwItL2CyblQRHlgCgfrYC8K6Rs0LQd9UqneE ZD6EXjsf7eSBhJ+2Acz1HLqoKq/qtIDa+VwVB/UqsBgCOqvWM+k813YBWIfl+D8D+6Jg0P XKAN9ULR0IsQbaxpMs6Y/3rll2wPvF+uziZuiOY4xZ37vy9GZSHSJVmH4bu3h0tz3p4+/x KmKMZnWxlvKuPesI9Is2Pw26AkePMywa+eD8713RMLrCmYvVirzkh3EKKjF+8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651273954; a=rsa-sha256; cv=none; b=IFrGxDWpIAVtBGEWvlamfMwjqO1lq8acY+X05jpe763qGZnBW3Q63X8dwhSe/uFV2lI/jp C6C8FRtH1bUwvR4R05TYHhwiDRWDRoDQWuPRcHe6O3n+aPgCwSNxP7UVFr8HQfYGI+h8Tj t49JWBtIE1t1iF9u9Ltr7P1HREENIARSmWkfY1zBZ8J4RJhYa4UcJSh10SsjgAt752522N 47Jsiy1KqlPTj6f7GFAkEGvde0k4P/cfHV41LeUx3q7uaVwv+EOX6iVbTbBytMhixLy4PD Tf95OHBpRCTHIknmvwD8mZMXdLJnHpQOtLIwGO2zfZ23RkqO7/Bhn3UBoy/6XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6a435d581fe2e7e1d0f05bc402ac5063898526f7 commit 6a435d581fe2e7e1d0f05bc402ac5063898526f7 Author: John Baldwin AuthorDate: 2022-01-18 17:28:43 +0000 Commit: John Baldwin CommitDate: 2022-04-29 22:55:32 +0000 iscsi: Abort fewer data-out tasks on a terminating session. Only abort tasks queued for datamove after cfiscsi_sesssion_terminate_tasks has posted its internal CTL_TASK_I_T_NEXUS_RESET task. Reported by: Jithesh Arakkan @ Chelsio Reviewed by: mav Fixes: 0cd6e85e242b iscsi: Abort data-out tasks queued on a terminating session. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D33747 (cherry picked from commit a3af69fa81d2341a3864edc67419de3b3bad77d9) --- sys/cam/ctl/ctl_frontend_iscsi.c | 7 ++++++- sys/cam/ctl/ctl_frontend_iscsi.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index b8ab25e89eb9..6e3505c86199 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -1155,6 +1155,7 @@ cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs) } CFISCSI_SESSION_LOCK(cs); + cs->cs_terminating_tasks = true; while ((cdw = TAILQ_FIRST(&cs->cs_waiting_for_data_out)) != NULL) { TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); CFISCSI_SESSION_UNLOCK(cs); @@ -2783,8 +2784,12 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_r2t_end = io->scsiio.ext_data_filled + r2t_len; CFISCSI_SESSION_LOCK(cs); - if (cs->cs_terminating) { + if (cs->cs_terminating_tasks) { CFISCSI_SESSION_UNLOCK(cs); + KASSERT((io->io_hdr.flags & CTL_FLAG_ABORT) != 0, + ("%s: I/O request %p on termating session %p not aborted", + __func__, io, cs)); + CFISCSI_SESSION_WARN(cs, "aborting data_wait for aborted I/O"); cfiscsi_data_wait_abort(cs, cdw, 44); return; } diff --git a/sys/cam/ctl/ctl_frontend_iscsi.h b/sys/cam/ctl/ctl_frontend_iscsi.h index 7c7f422a8d1f..165f0ad79d70 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.h +++ b/sys/cam/ctl/ctl_frontend_iscsi.h @@ -84,6 +84,7 @@ struct cfiscsi_session { int cs_timeout; struct cv cs_maintenance_cv; bool cs_terminating; + bool cs_terminating_tasks; bool cs_handoff_in_progress; bool cs_tasks_aborted; int cs_max_burst_length;