From nobody Tue Oct 19 15:06:54 2021 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 88DAE1805850; Tue, 19 Oct 2021 15:06:54 +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 4HYcXZ3Pbrz3hLP; Tue, 19 Oct 2021 15:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 4F38E1655B; Tue, 19 Oct 2021 15:06:54 +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 19JF6si8069783; Tue, 19 Oct 2021 15:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JF6s6b069782; Tue, 19 Oct 2021 15:06:54 GMT (envelope-from git) Date: Tue, 19 Oct 2021 15:06:54 GMT Message-Id: <202110191506.19JF6s6b069782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7e321b97917d - stable/13 - cam(4): Limit search for disks in SES enclosure by single bus 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e321b97917dce5274972a6bc5eee94c6ad4cfc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7e321b97917dce5274972a6bc5eee94c6ad4cfc4 commit 7e321b97917dce5274972a6bc5eee94c6ad4cfc4 Author: Alexander Motin AuthorDate: 2021-10-05 19:01:16 +0000 Commit: Alexander Motin CommitDate: 2021-10-19 15:06:52 +0000 cam(4): Limit search for disks in SES enclosure by single bus At least for SAS that we only support now disks are typically connected to the same bus as the enclosure. Limiting the search scope makes it much faster on systems with multiple buses and thousands of disks. Reviewed by: imp MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D32305 (cherry picked from commit 730ea72c706ef8e025616772cfd86fd89ed3d42e) --- sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index 014fe9fcd525..d20f3dec4e52 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -374,6 +374,10 @@ typedef struct ses_softc { ses_control_reqlist_t ses_pending_requests; } ses_softc_t; +static int ses_search_globally = 0; +SYSCTL_INT(_kern_cam_enc, OID_AUTO, search_globally, CTLFLAG_RWTUN, + &ses_search_globally, 0, "Search for disks on other buses"); + /** * \brief Reset a SES iterator to just before the first element * in the configuration. @@ -890,6 +894,10 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_element_t *elem, + devid->length; memcpy(device_pattern->data.devid_pat.id, devid, device_pattern->data.devid_pat.id_len); + if (!ses_search_globally) { + device_pattern->flags |= DEV_MATCH_PATH; + device_pattern->path_id = xpt_path_path_id(enc->periph->path); + } memset(&cdm, 0, sizeof(cdm)); if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL,