1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-09 09:40:42 +00:00

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
This commit is contained in:
Alexander Motin 2021-10-05 15:01:16 -04:00
parent 8f9be1eed1
commit 730ea72c70

View File

@ -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,