From nobody Tue Jan 18 17:30:03 2022 X-Original-To: dev-commits-src-all@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 0B3A0196A4BD; Tue, 18 Jan 2022 17:30:04 +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 4JdbPl4MMxz3FrG; Tue, 18 Jan 2022 17:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642527003; 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=bfKy4i6Xhb2ZHi32+9aJBGatZBDWZ3LDla26KS2DHEI=; b=B3FppalilzX/3RbutGowlqHRA/vo3igFbOgqLxk+j+rUhB91LDu3ExtSjXfZcbUw/3VuAh jCXu1eI8Hnpn8wRYk8s6+D1oGP/sn10llul+JEPRKMojIq0HKx7nmJqxtWuTtBS+icXnDF z0zr0iAj64aVI6zmadfThrxUvT4fVhRBP8Vah9tl8yY0u/acnovQ1EbiHLWcLDqJXtLTjw KVOpUbZE1EKOvvbUn5vqXjPEa5tXQb1JNCqEmldW6g7zzDsu7vnlyVhBATEatW+CMdc1oa 0n4mHNcMVs5J+N4VrnQf+bGjCW8225CkXjKLBBzclvThP2uI7ZPzHmxhhXzrAQ== 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 614F9254AC; Tue, 18 Jan 2022 17:30:03 +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 20IHU3oU026658; Tue, 18 Jan 2022 17:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20IHU3jo026655; Tue, 18 Jan 2022 17:30:03 GMT (envelope-from git) Date: Tue, 18 Jan 2022 17:30:03 GMT Message-Id: <202201181730.20IHU3jo026655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a3af69fa81d2 - main - iscsi: Abort fewer data-out tasks on a terminating session. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: a3af69fa81d2341a3864edc67419de3b3bad77d9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642527003; 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=bfKy4i6Xhb2ZHi32+9aJBGatZBDWZ3LDla26KS2DHEI=; b=DDMhZMSX9iDYWa/NMawpjLDtd0h4sPs0jXD/ifLfTOLA+SNJc3edw1kg9VJCOx+Ql2mQcD ioiHKWbwzExCchuvUBgIOfYShcVBG43NXaJSTHZauxt61hKPjsNYxeLq2ydH9WZ5Twq6+Y K1VN2YVChS0N14HB8SwSHdzY5Bn3uGWCxfcHNu36/ehaicbY7iINrPwlQF0L+hEQHr/ycG 5Lkuope8YGEe3QARUkxpJc8eJdgMzjp5BCh7dATLy3wgQAXjPuqsa60ZGllMqnfm2WJccS HcDrQBhLuI3a5NtxWO7VoaU4k1C/KQe3RlugxYQT3ev4Fy4jUkIEdwcLR/GNkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642527003; a=rsa-sha256; cv=none; b=MH4I+OoLQJynu2xTH5xZy9E8g6M0bWVdxBVc6WFRfe7Qy3Xxzhqz5hZnRXvtH/TJyOD/om KRmXceJus1QNM/M/KUG3Fcbcf48RfQEP2O/4W7zuMGMy2sz7a/Iz2bA5RmACVQk8tolwL9 N6ZxQyXQPuodEcCwi0zPTi26tRIv05JepmB82VxQfWkd7Ir0d6fjPe4u8GVlaewopXO57G x+HwJRCmTZy+d6uhVQ5PeSSaMFiUVY48GrEqYeO7pAhtNTE9A7hCNVbdmT7fu1eTF4VAQi LqYJKIDoW1002moR4Mf0zKxvlAquVSbDMUD6E8D/ZdMr05Ji8/ivFV9B/2uKNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a3af69fa81d2341a3864edc67419de3b3bad77d9 commit a3af69fa81d2341a3864edc67419de3b3bad77d9 Author: John Baldwin AuthorDate: 2022-01-18 17:28:43 +0000 Commit: John Baldwin CommitDate: 2022-01-18 17:28:43 +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 --- 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 6368a81fe66f..42abc49b7025 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;