From nobody Mon Oct 14 05:41:00 2024 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 4XRmL53991z5ZCsM; Mon, 14 Oct 2024 05:41:01 +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 4XRmL51vBMz411P; Mon, 14 Oct 2024 05:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728884461; 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=JxvUB/j65dkYt225+PBLM/pDBDq3v0RloeJDbZXITGw=; b=X0QprHF/Z2atOB02hBVp8op6jjljxMs573KR7PBQQBpA1gYQanPKQocD9o+u6zmTMUE5FV mMKp9vyfh0V/Ksr0742HngR6cbRQE3B5qv+WieCYxdXir4QOdpo8TkzNknmj1W6HIHbap5 xNzpEGWRJCdWMwNjbylmcObTTeFSDgfpXpy5kCZ4+q621Rlfeb9TYBQOLG5BCtWuAvEM19 TP5QE9QjR0fLX8Oehnszr6B95Req+dKJazrfx6Xtmds0zjBXYxcDE7wdd4q336ExYUsL3u pGAvO4KpnyUgC6uPG+5uJbvny+a6u4NM5E355gGwD0yD3c5+ieghYLwPGnq8jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728884461; 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=JxvUB/j65dkYt225+PBLM/pDBDq3v0RloeJDbZXITGw=; b=iZeZwTae/xmp/18t9PvFMaToh2GV4j2D8iE1tpT5Ug9EhxhTR50mHxDqtCPw/rGYxvkDh3 ShEcIzNsJNbF2KCiAWkTTn6YdxPEi6k4YhrRcHEdhF5bEb/TLQiOwcdq8l3TiYxBz4tJIG ms952C9Q5mGDfiG5vtn2FV29xEcGU2i7ekaS9dF5xfASRgOzisx8OBbaqeL5mhfbaXew8F YI3WTp3fxl483lPy6TzvCRB855a5BXIVKlWPegw/J4nXOzaeejJ7wLRdqa6dZtuVA+cqlf A79fZOuRFdJIHUgGgzcgWdSFlpWiGoAYU2jcqxxB5xUJ50icaNue9cCG86jb0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728884461; a=rsa-sha256; cv=none; b=VWpMFNMbubzHNkYtRx7yggiS02Scddd/kcbq23a8tsF9GGh5AUQ6tBS8RuMO1gM/Wnz7w1 4W1HYyJWmI1uWyE6+BL6tLdxtBV9WU7D2Y/UI7KQx9raOm9ImioiIzqBbZie7+zBAnoJwh f7C0uzmo79x97rMzAdgkZuDaAES1YlKHUxTyK0HDbk2L5B+PE64odQUUUHxqbEkU1qKSrx oDQac1mMu8MhZyh6XVywxU4zd5CQsG6DCuIysy1kqe+wWTlytKuYpFQ5MhmVa4F8LHLZab AepJbSG3FtJAThaCG3y3G2G+uJcQIQwEjqORpini4642ChG7cBV7baGwgqixFw== 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 4XRmL45p8TzQjW; Mon, 14 Oct 2024 05:41:00 +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 49E5f0nA089690; Mon, 14 Oct 2024 05:41:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49E5f0vR089687; Mon, 14 Oct 2024 05:41:00 GMT (envelope-from git) Date: Mon, 14 Oct 2024 05:41:00 GMT Message-Id: <202410140541.49E5f0vR089687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 45645518ea19 - main - ciss: Add max physical target 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45645518ea19ccb4761aee3a525aab2f323d37d4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=45645518ea19ccb4761aee3a525aab2f323d37d4 commit 45645518ea19ccb4761aee3a525aab2f323d37d4 Author: Peter Eriksson AuthorDate: 2024-10-14 04:01:33 +0000 Commit: Warner Losh CommitDate: 2024-10-14 05:24:15 +0000 ciss: Add max physical target Add support for tracking the maximum physical target and using that to override the maximum logical target. PR: 246279 Reviewed by: imp Tested by: Marek Zarychta Differential Revision: https://reviews.freebsd.org/D25155 --- sys/dev/ciss/ciss.c | 11 ++++++++++- sys/dev/ciss/cissvar.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index bb33ad17306f..a6071735c87b 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -1544,6 +1544,9 @@ ciss_init_physical(struct ciss_softc *sc) nphys, (nphys > 1 || nphys == 0) ? "s" : ""); } + /* Per-controller highest target number seen */ + sc->ciss_max_physical_target = 0; + /* * Figure out the bus mapping. * Logical buses include both the local logical bus for local arrays and @@ -1626,6 +1629,8 @@ ciss_init_physical(struct ciss_softc *sc) } ciss_filter_physical(sc, cll); + if (bootverbose || ciss_verbose) + ciss_printf(sc, "max physical target id: %d\n", sc->ciss_max_physical_target); out: if (cll != NULL) @@ -1675,6 +1680,10 @@ ciss_filter_physical(struct ciss_softc *sc, struct ciss_lun_report *cll) target = CISS_EXTRA_TARGET2(ea); sc->ciss_physical[bus][target].cp_address = cll->lun[i]; sc->ciss_physical[bus][target].cp_online = 1; + + if ((target > sc->ciss_max_physical_target) && + (cll->lun[i].physical.mode != CISS_HDR_ADDRESS_MODE_MASK_PERIPHERAL)) + sc->ciss_max_physical_target = target; } return (0); @@ -3062,7 +3071,7 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = sc->ciss_cfg->max_logical_supported; + cpi->max_target = MAX(sc->ciss_max_physical_target, sc->ciss_cfg->max_logical_supported); cpi->max_lun = 0; /* 'logical drive' channel only */ cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); diff --git a/sys/dev/ciss/cissvar.h b/sys/dev/ciss/cissvar.h index eec11018d279..58275f83732c 100644 --- a/sys/dev/ciss/cissvar.h +++ b/sys/dev/ciss/cissvar.h @@ -236,6 +236,7 @@ struct ciss_softc int ciss_max_bus_number; /* maximum bus number */ int ciss_max_logical_bus; int ciss_max_physical_bus; + int ciss_max_physical_target; /* highest physical target number */ struct cam_devq *ciss_cam_devq; struct cam_sim **ciss_cam_sim;