From nobody Wed Jan 08 18:18:17 2025 X-Original-To: dev-commits-src-main@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 4YSx4B25FCz5kv5N; Wed, 08 Jan 2025 18:18:18 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSx4B12m2z4Dl1; Wed, 8 Jan 2025 18:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360298; 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=nfeE139so1ElQhnTqtHPdvWMMxZtafJdNvkfOihxRG0=; b=JU2clyWRKo6Ds7YqrqEbdmLSUk4Z8ZqOjIxaKA/76uOSTK38Sa282tp8VUeVpUG/mCSfoI wphFidRAxerZlkzE+rFDFvcZOKj0nhrEtTk0Xe3/B55Pl9FqIxi1YQmGnkaGqW9hVPt6PW WHPph8u/HyD321EPNFUyFnGioBFrd24W7pwctUaeV9AQproWrRV4gww8+mL6D1FZpkP1lo 3YHyHHfbWPXVCxLtN4K/abdtEM2XHE6vhB9MYDGzdh98r2mr1dTGRD1jFJ9ZTNHLZpka5+ 22HkZhTwF4y87O7064Ccz0cqDSxU/+r9h3/e+rqqqLwPIrH/QDrbeG++qUmdpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360298; 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=nfeE139so1ElQhnTqtHPdvWMMxZtafJdNvkfOihxRG0=; b=wagomXZL3sN1jOEAO4FGs/SGQZciX+e+7asLzUxl5FcLLUQyDgEYnaj4NtqgEYAK2mdrFf Zbtx1+T7UKi2JCJhkJel4oxnYJtQvzFqBRBVY+52TD+bkzShckXQj+ehL6aDagTjGFYh1z 4uwHwTGZYyRGzjrwFEMptMkucB2fzkSvLB/cWTE4nzN/nqCEeUB2/9l4vo0Ff6GJwplK8b jpp10mYGYPwf3IJ8NuEpxgj6tugJFCOleY6zAM2Yr4v6QLZqxr+h+VdGM5xB3f4h3CEpoq fjupbSCL1lHBWzb+ZbQPNC0zsK5DuG/Cgfd0lf7UUMPOwDhQM+gmCHolaYkmmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736360298; a=rsa-sha256; cv=none; b=xGv4NXWkiAjoJt1XwNWdknEZ0/bFKRjMuBkI+rjm76mFb5SuqOBywiX6vbyT/T/fcQP4/S lIQOXlf0/EIpZdaUIb1Hc/RdCGHqbfAJYA4H+/+RokiC8rIRMtSIc9knhp6kOPfVj5zMAi XHA3aTXsT2n8cVhSJK9fZL2xvvP/5j/g4WIOpTtTkFtegOA1Wf91TybJSbG7a8E4LM+Cgf 0lwm0ox8gp+LQClpJlKfnku5RJoUt7Owd2wUzuXfBSdILrJTbk2SMLTJkGFprpvv8+A1w4 4L585LcBQtN1Iih3AihcnM0ssKZjnsYvkr29wKIVNZSxymNTeknK3uW9zX4Suw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YSx4B0Sdnz16QH; Wed, 08 Jan 2025 18:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 508IIHlJ025503; Wed, 8 Jan 2025 18:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 508IIHcG025500; Wed, 8 Jan 2025 18:18:17 GMT (envelope-from git) Date: Wed, 8 Jan 2025 18:18:17 GMT Message-Id: <202501081818.508IIHcG025500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 1f7c379c0716 - main - isp: Fix abort issue introduced by previous commit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f7c379c07168029694a9a33bc437b05cdee623e Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7c379c07168029694a9a33bc437b05cdee623e commit 1f7c379c07168029694a9a33bc437b05cdee623e Author: Alexander Motin AuthorDate: 2025-01-08 18:04:34 +0000 Commit: Alexander Motin CommitDate: 2025-01-08 18:04:34 +0000 isp: Fix abort issue introduced by previous commit Aborting ATIO while its CTIOs are in progress makes impossible to handle their completions, making them stuck forever. Detect this case by checking ctcnt counter and if so instead of aborting just mark the ATIO as dead to block any new CTIOs. It is not perfect since the task id can not be reused for some more time, but not as bad as the task stuck forever. MFC after: 1 week --- etc/mtree/BSD.include.dist | 2 ++ include/Makefile | 2 +- sys/conf/files.amd64 | 2 ++ sys/dev/isp/isp_freebsd.c | 19 +++++++++++++++++-- sys/dev/isp/isp_freebsd.h | 3 ++- sys/modules/Makefile | 2 ++ usr.sbin/Makefile | 1 + 7 files changed, 27 insertions(+), 4 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index ad1b8a5f7413..0a2dbea23d5a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -149,6 +149,8 @@ .. io .. + ixnvdimm + .. mfi .. mlx5 diff --git a/include/Makefile b/include/Makefile index 16d641b42a90..0c71f1518a91 100644 --- a/include/Makefile +++ b/include/Makefile @@ -50,7 +50,7 @@ LDIRS= geom net net80211 netgraph netinet netinet6 \ LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ - dev/ic dev/iicbus dev/io dev/mfi dev/mmc \ + dev/ic dev/iicbus dev/io dev/ixnvdimm dev/mfi dev/mmc \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \ fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 0584fc29d039..571e61f6b264 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -235,6 +235,8 @@ dev/ixl/i40e_adminq.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_dcb.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixnvdimm/ixnvdimm.c optional ixnvdimm +dev/ixnvdimm/ixnvdimm_copy.S optional ixnvdimm dev/ncthwm/ncthwm.c optional ncthwm superio dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d5aa7a54142e..b496eae1b466 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,6 +986,16 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } + /* + * Is this command a dead duck? + */ + if (atp->dead) { + isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + continue; + } + /* * Check to make sure we're still in target mode. */ @@ -2503,14 +2513,19 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected CCBs before ACK-ing INOT, + * Target should abort all affected tasks before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. + * We can not do it if some CTIOs are in progress, or we won't + * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (atp->ctcnt == 0 && + isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); + else + atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 5bb3dd43b6de..73390fa14769 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,8 +104,9 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint8_t srr_notify_rcvd : 1, + uint16_t srr_notify_rcvd : 1, sendst : 1, + dead : 1, tattr : 3, state : 3; void * ests; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 294cb5a224de..3451928e2e53 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -203,6 +203,7 @@ SUBDIR= \ ${_ix} \ ${_ixv} \ ${_ixl} \ + ${_ixnvdimm} \ jme \ kbdmux \ kgssapi \ @@ -834,6 +835,7 @@ _enic= enic _iavf= iavf _ioat= ioat _ixl= ixl +_ixnvdimm= ixnvdimm _nvdimm= nvdimm _pms= pms _qat= qat diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index e039cea6ee16..2eeff6980836 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -34,6 +34,7 @@ SUBDIR= adduser \ ifmcstat \ iostat \ iovctl \ + ixnvdimm \ kldxref \ mailwrapper \ makefs \