From nobody Wed Sep 16 08:41:12 2026 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 4hlC664vbkz6str8 for ; Wed, 16 Sep 2026 08:41: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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hlC660tj5z4q9C for ; Wed, 16 Sep 2026 08:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789548078; 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=NTOAOF428kVEdkgaU4JkVu8M3fCsYJ4dCOjmK8GFe48=; b=SVfoEyYkB3MjFUyyqtxT5was669/ytBaTGJ4ymwQQLCqTKJSFQrDXzpNOuEqdMn2XqPOtx hYR4BwYGARLAVYmDC9v+0d3O/JWK28xwyVgvYS0s/Df4cdzje+CvWsJ6xYe37Rb84jG2HE NC4q5KEzz/oGkA8F85LLUZoS3KIVlfkWTOv+mC3/iy9UgD0SSp4hhh/8WYO6ZKNE+7wtKs Ryv7Ij99bBU85AzV3nHk8vHkS8yp2T3F/rtrLpCCB2+ZgJlg6Rc+6ymfeSVderpOQgHyOb GOrhkAzI5Wdd+ebWUFiirZm2AZOKeY9e6ybPkRP65t27DptxyQIBBYda06qaeQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789548078; b=UE2Xa+MZqFOY6VYIdOiAJo3X5PszemDDi5SeDIp0ULvjfW6/+HHj4jB0njtSonOSh80vBG NsWDUR1kiS4aAZpg7oOfZoDCRGN5HICR6F06qxi85M3/h289OArETia2qe7TV8DYiwjWgq 04vQTIl9pSy5jix6QuL8Wdd49DcwGDrNZlGcp7QMbwfyBv3Bbh5WOAmDbQzPWv+u2kfpux sAc25I+QmpyVyzNtw79Q1lTZb8CxXORgqLoEYL8X8feCSX7/Rw5sOL0A9ggSDnF/SgAFWI lQTZGw9V0TP59NucgYcZVby5zU1q8cCTnGb3CqtqXeVWhvhSP1zz2Qkenu7KEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789548078; 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=NTOAOF428kVEdkgaU4JkVu8M3fCsYJ4dCOjmK8GFe48=; b=mlwNg3WDH4wMquUplGXvFrc7nD2pgJCKMh8M5fWHci7xx0QFV4MqELZUZ9JDI7xhIKuE8F u0KO8c2DmcdS1Tveh5i18eqOt3rXm1Ps7U78sGW0pwo8yfGBeWkJpQj82WIsT++n0TPhLL NaWu+hR1fRAy+qvasT1j4jg3KcBkQPseJ3hTbGpyPIiSxlVeR5wLq9RyLSMfPf6voRV82q bm8+f8eZuzNv5gaddOfOsnmxHxC+HeibFy5qirmGOccGn4zAfbvpa0EseKbU4HaMWxgMzT XdAp7zLCLWDYhSxWAqVtQ9RShtp4CIemN/DuMqJv7InjFQg+pBFcKJa8dW1CJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hlC6572zLzgB2 for ; Wed, 16 Sep 2026 08:41:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b5de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 16 Sep 2026 08:41:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: acdb2cdcd6ec - main - mfiutil(8)/mrsasutil(8): display/parse enclosure by device ID (EID) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: acdb2cdcd6ec6738c4f523df09ccd55404c6eb55 Auto-Submitted: auto-generated Date: Wed, 16 Sep 2026 08:41:12 +0000 Message-Id: <6aaa5628.3b5de.38c809bd@gitrepo.freebsd.org> The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=acdb2cdcd6ec6738c4f523df09ccd55404c6eb55 commit acdb2cdcd6ec6738c4f523df09ccd55404c6eb55 Author: Michael Osipov AuthorDate: 2026-09-13 19:55:28 +0000 Commit: Michael Osipov CommitDate: 2026-09-16 08:40:55 +0000 mfiutil(8)/mrsasutil(8): display/parse enclosure by device ID (EID) mfi_drive_name() built the "Exx:Syy" drive location string using struct mfi_pd_info's encl_index field, the enclosure's firmware- internal position index. Broadcom's own storcli/MegaCli tooling instead leads with the enclosure's Device ID (EID) in its primary drive listing; encl_index only shows up as "Position" in a detailed per-enclosure view. Both numbers are raw, unmodified firmware values already fetched into struct mfi_pd_info/mfi_pd_address, but only encl_index was ever displayed or accepted as input, leading to confusion when cross-referencing drive locations against storcli output. Switch mfi_drive_name() and mfi_lookup_drive() to use encl_device_id instead, aligning FreeBSD's enclosure numbering with Broadcom's own utilities. Since mrsasutil(8) is the same binary as mfiutil(8) under a different name, this applies to both mfi(4) and mrsas(4) alike. This is a user-visible behavior change: the numeric value of "xx" in "Exx:Syy" now differs from before for any enclosure whose EID and position index don't match, affecting anyone scripting against the previous numbering. PR: 294353 Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D59654 --- UPDATING | 9 +++++++++ usr.sbin/mfiutil/mfi_drive.c | 15 +++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/UPDATING b/UPDATING index 35c60c5363af..9cccbec2657b 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260916: + mfiutil(8)/mrsasutil(8) now display and parse the Exx:Syy drive + location notation using the controller's enclosure device ID (EID) + instead of its firmware-internal enclosure position index, aligning + with Broadcom's storcli/MegaCli tooling. This changes the numeric + value of "xx" for enclosures where the two differ; scripts relying + on the previous numbering should be updated to use "show drives" + output or storcli's EID column. + 20260914: The size of multiple embedded structs have changed and may lead to problems (pci_error_handlers in pci_driver, dev_pm_info in struct device). diff --git a/usr.sbin/mfiutil/mfi_drive.c b/usr.sbin/mfiutil/mfi_drive.c index 88d24623ae27..1f0c40020762 100644 --- a/usr.sbin/mfiutil/mfi_drive.c +++ b/usr.sbin/mfiutil/mfi_drive.c @@ -108,10 +108,10 @@ mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) pinfo->slot_number); else if (pinfo->encl_device_id == pinfo->ref.v.device_id) sbuf_printf(&sb, "E%u", - pinfo->encl_index); + pinfo->encl_device_id); else sbuf_printf(&sb, "E%u:S%u", - pinfo->encl_index, pinfo->slot_number); + pinfo->encl_device_id, pinfo->slot_number); } sbuf_finish(&sb); @@ -156,7 +156,8 @@ mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) int error; u_int i; char *cp; - uint8_t encl, slot; + uint16_t encl; + uint8_t slot; /* Look for a raw device id first. */ val = strtol(drive, &cp, 0); @@ -175,14 +176,14 @@ mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) if (toupper(drive[0]) == 'E') { cp++; /* Eat 'E' */ val = strtol(cp, &cp, 0); - if (val < 0 || val > 0xff || *cp != ':') + if (val < 0 || val >= 0xffff || *cp != ':') goto bad; encl = val; cp++; /* Eat ':' */ if (toupper(*cp) != 'S') goto bad; } else - encl = 0xff; + encl = 0xffff; cp++; /* Eat 'S' */ if (*cp == '\0') goto bad; @@ -201,9 +202,7 @@ mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) if (list->addr[i].scsi_dev_type != 0) continue; - if (((encl == 0xff && - list->addr[i].encl_device_id == 0xffff) || - list->addr[i].encl_index == encl) && + if (list->addr[i].encl_device_id == encl && list->addr[i].slot_number == slot) { *device_id = list->addr[i].device_id; free(list);